diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 120553cca..63d5a7ad7 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -413,14 +413,15 @@ fi ln -sf $RPM_INSTALL_PREFIX0/sbin/xcatd /usr/sbin/xcatd if [ "$1" = "1" ]; then #Only if installing for the first time.. - if [ -x /usr/lib/lsb/install_initd ]; then - /usr/lib/lsb/install_initd /etc/init.d/xcatd - elif [ -x /sbin/chkconfig ]; then - /sbin/chkconfig --add xcatd - else - echo "Unable to register init scripts on this system" - fi + if [ -x /sbin/chkconfig ]; then + /sbin/chkconfig --add xcatd + elif [ -x /usr/lib/lsb/install_initd ]; then + /usr/lib/lsb/install_initd /etc/init.d/xcatd + else + echo "Unable to register init scripts on this system" + fi fi + if [ "$1" -gt "1" ]; then #only on upgrade... #migration issue for monitoring XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab filename=monitorctrl.pm notification -d @@ -463,10 +464,11 @@ if [ $1 == 0 ]; then #This means only on -e if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image /etc/init.d/xcatd stop fi - if [ -x /usr/lib/lsb/remove_initd ]; then + + if [ -x /sbin/chkconfig ]; then + /sbin/chkconfig --del xcatd + elif [ -x /usr/lib/lsb/remove_initd ]; then /usr/lib/lsb/remove_initd /etc/init.d/xcatd - elif [ -x /sbin/chkconfig ]; then - /sbin/chkconfig --del xcatd fi rm -f /usr/sbin/xcatd #remove the symbolic