From c9046c06b7e6002b28adc1fb3796f05811f60847 Mon Sep 17 00:00:00 2001 From: Jete Date: Sun, 20 Jul 2014 01:43:30 -0400 Subject: [PATCH] CentOS 7 now uses SystemD instead of SysV Ensure centos 7 is capable of using systemd for checking if the service is running/restarting --- bootstrap-salt.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a393c6b..3a8391d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2591,6 +2591,10 @@ install_centos_restart_daemons() { # Still in SysV init!? /etc/init.d/salt-$fname stop > /dev/null 2>&1 /etc/init.d/salt-$fname start + elif [ -f /usr/bin/systemctl ]; then + # CentOS 7 uses systemd + /usr/bin/systemctl stop salt-$fname > /dev/null 2>&1 + /usr/bin/systemctl start salt-$fname.service fi done } @@ -2620,6 +2624,8 @@ install_centos_check_services() { __check_services_upstart salt-$fname || return 1 elif [ -f /etc/init.d/salt-$fname ]; then __check_services_sysvinit salt-$fname || return 1 + elif [ -f /usr/bin/systemctl ]; then + __check_services_systemd salt-$fname || return 1 fi done return 0