diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 1ff537109..2060040af 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -190,12 +190,15 @@ rm -rf $RPM_BUILD_ROOT %post %ifos linux ln -sf $RPM_INSTALL_PREFIX0/sbin/xcatd /usr/sbin/xcatd -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" + +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 fi if [ "$1" -gt "1" ]; then #only on upgrade... #migration issue for monitoring