If system is using systemd, enable services.

Closes #425.
This commit is contained in:
Pedro Algarvio 2014-07-20 19:17:15 +01:00
parent 6201cab749
commit 215a6cd250

View file

@ -2496,6 +2496,14 @@ install_centos_stable_post() {
if [ -f /etc/init.d/salt-$fname ]; then
# Still in SysV init!?
/sbin/chkconfig salt-$fname on
elif [ -f /usr/bin/systemctl ]; then
# Using systemd
/usr/bin/systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || (
/usr/bin/systemctl preset salt-$fname.service > /dev/null 2>&1 &&
/usr/bin/systemctl enable salt-$fname.service > /dev/null 2>&1
)
sleep 0.1
/usr/bin/systemctl daemon-reload
fi
done
}