[remaster/mcs] fix 389-ds init after install and do not start 389 at all in install mode

This commit is contained in:
Fabio Erculiani 2010-11-12 13:27:57 +01:00
parent f135f672a5
commit 0996deb099
2 changed files with 16 additions and 3 deletions

View File

@ -9,6 +9,15 @@ _is_live() {
fi fi
} }
_is_installer_mode() {
is_installer=$(cat /proc/cmdline | grep installer)
if [ -n "${is_installer}" ]; then
return 0
else
return 1
fi
}
_setup_fds_live() { _setup_fds_live() {
# setup 389-ds # setup 389-ds
tmp_config_file="$(mktemp)" tmp_config_file="$(mktemp)"
@ -32,7 +41,7 @@ ServerIpAddress=127.0.0.1
ServerAdminID=admin ServerAdminID=admin
ServerAdminPwd=mcsmanager ServerAdminPwd=mcsmanager
" > "${tmp_config_file}" " > "${tmp_config_file}"
# FIXME: calling the script directly, from init, won't work, WTF!
su - -c "/usr/sbin/setup-ds-admin.pl -f ${tmp_config_file} --silent" || return 1 su - -c "/usr/sbin/setup-ds-admin.pl -f ${tmp_config_file} --silent" || return 1
# init MCS ldap data # init MCS ldap data
@ -51,8 +60,8 @@ _setup_fds_installed() {
if [ -e "${FDS_SETUP_FILE}" ]; then if [ -e "${FDS_SETUP_FILE}" ]; then
return return
fi fi
# First, setup 389 # First, setup 389, if not in installer mode
_setup_fds_live _is_installer_mode || _setup_fds_live
# then make it autostart at the next boot # then make it autostart at the next boot
rc-update add 389-ds default rc-update add 389-ds default
rc-update add 389-admin default rc-update add 389-admin default

View File

@ -143,6 +143,10 @@ chown jboss:jboss /opt/jboss-bin-4.2/server/default/conf/login-config.xml || exi
cp /.mcs/mailware-jboss-conf/jboss-log4j.xml /opt/jboss-bin-4.2/server/default/conf/jboss-log4j.xml || exit 1 cp /.mcs/mailware-jboss-conf/jboss-log4j.xml /opt/jboss-bin-4.2/server/default/conf/jboss-log4j.xml || exit 1
chown jboss:jboss /opt/jboss-bin-4.2/server/default/conf/jboss-log4j.xml || exit 1 chown jboss:jboss /opt/jboss-bin-4.2/server/default/conf/jboss-log4j.xml || exit 1
# temp fix (waiting for updated pkgs) for 389-ds dir perms
chmod 755 /var/lock/dirsrv || exit 1
chmod 755 /var/lib/dirsrv || exit 1
# setup 389 schema # setup 389 schema
cp /.mcs/389-mailware-schema/* /etc/dirsrv/schema/ || exit 1 cp /.mcs/389-mailware-schema/* /etc/dirsrv/schema/ || exit 1
chown root:root /etc/dirsrv/schema/*.ldif -R || exit 1 chown root:root /etc/dirsrv/schema/*.ldif -R || exit 1