From 47be06602dbfb25db6473477db30230669ca3fc0 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 8 Feb 2013 12:09:37 +0000 Subject: [PATCH] Added start daemons function support to CentOS git installations. --- bootstrap-salt.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index caf1758..0dac3e6 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -960,7 +960,25 @@ install_centos_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 + # Still in SysV init?! + elif [ ! -f /etc/init.d/salt-$fname ]; then + cp ${SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname} /etc/init.d/ + chmod +x /etc/init.d/salt-${fname} + fi + /sbin/chkconfig salt-${fname} on + done +} +install_centos_git_start_daemons() { + for fname in master minion 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 @@ -974,13 +992,7 @@ install_centos_git_post() { fi fi - # Still in SysV init?! - if [ ! -f /etc/init.d/salt-$fname ]; then - cp ${SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname} /etc/init.d/ - chmod +x /etc/init.d/salt-${fname} - fi - /sbin/chkconfig salt-${fname} on /etc/init.d/salt-${fname} start & done }