Moved Ubuntu git installations to use the new start daemons function.

* This is only done in git installations because Ubuntu defines that any daemon should run right after installing.
This commit is contained in:
Pedro Algarvio 2013-02-08 11:56:03 +00:00
parent 00d4c44e28
commit 0cd2397fe9

View file

@ -637,7 +637,25 @@ install_ubuntu_git_post() {
# upstart does not know about our service, let's copy the proper file
cp ${SALT_GIT_CHECKOUT_DIR}/pkg/salt-$fname.upstart /etc/init/salt-$fname.conf
fi
# No upstart support in Ubuntu!?
elif [ -f ${SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init ]; then
cp ${SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init /etc/init.d/salt-$fname
chmod +x /etc/init.d/salt-$fname
update-rc.d salt-$fname defaults
fi
done
}
install_ubuntu_git_start_daemons() {
for fname in minion master syndic; do
# Skip if not meant to be installed
[ $fname = "minion" ] && [ $INSTALL_MINION -eq 0 ] && continue
[ $fname = "master" ] && [ $INSTALL_MASTER -eq 0 ] && continue
[ $fname = "syndic" ] && [ $INSTALL_SYNDIC -eq 0 ] && continue
if [ -f /sbin/initctl ]; then
# We have upstart support
/sbin/initctl status salt-$fname > /dev/null 2>&1
if [ $? -eq 0 ]; then
# upstart knows about this service
@ -650,12 +668,6 @@ install_ubuntu_git_post() {
# We failed to start the service, let's test the SysV code bellow
fi
fi
# No upstart support in Ubuntu!?
if [ -f ${SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init ]; then
cp ${SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init /etc/init.d/salt-$fname
chmod +x /etc/init.d/salt-$fname
fi
/etc/init.d/salt-$fname restart &
done
}