diff options
author | David Spencer <idlemoor@slackbuilds.org> | 2016-11-17 17:41:26 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-11-19 07:31:28 +0700 |
commit | 206336c0bcbffbdd89d55453feb6bf29dcb62243 (patch) | |
tree | 09f9a267edbe6cadb5b8dacdaf53bf220b4e7d42 /system/salt/rc.salt-syndic.new | |
parent | 2d76c763409a2a6bb74a308faca8384ebabdc2e3 (diff) | |
download | slackbuilds-206336c0bcbffbdd89d55453feb6bf29dcb62243.tar.gz |
system/salt: Updated for version 2016.3.4.
Thanks to bjwebb.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system/salt/rc.salt-syndic.new')
-rw-r--r-- | system/salt/rc.salt-syndic.new | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/system/salt/rc.salt-syndic.new b/system/salt/rc.salt-syndic.new new file mode 100644 index 0000000000..c8986e21a2 --- /dev/null +++ b/system/salt/rc.salt-syndic.new @@ -0,0 +1,49 @@ +#!/bin/sh +# Start/stop/restart salt syndic + +PIDFILE=/var/run/salt-syndic.pid +LOGFILE=/var/log/salt/syndic +# LOGLEVEL: One of: all, garbage, trace, debug, info, warning, error, quiet +LOGLEVEL=warning + +# Start salt-syndic: +salt_syndic_start() { + if [ -x /usr/bin/salt-syndic ]; then + echo "Starting salt-syndic daemon: /usr/bin/salt-syndic" + /usr/bin/salt-syndic -d \ + --pid-file=$PIDFILE \ + --log-file=$LOGFILE \ + --log-file-level=$LOGLEVEL + fi +} + +# Stop salt-syndic: +salt_syndic_stop() { + if [ -s $PIDFILE ] ; then + kill $(cat $PIDFILE) + else + killall salt-syndic + fi + rm -f $PIDFILE +} + +# Restart salt-syndic: +salt_syndic_restart() { + salt_syndic_stop + sleep 1 + salt_syndic_start +} + +case "$1" in +'start') + salt_syndic_start + ;; +'stop') + salt_syndic_stop + ;; +'restart') + salt_syndic_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac |