From 206336c0bcbffbdd89d55453feb6bf29dcb62243 Mon Sep 17 00:00:00 2001 From: David Spencer Date: Thu, 17 Nov 2016 17:41:26 +0000 Subject: system/salt: Updated for version 2016.3.4. Thanks to bjwebb. Signed-off-by: David Spencer --- system/salt/rc.salt-master.new | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 system/salt/rc.salt-master.new (limited to 'system/salt/rc.salt-master.new') diff --git a/system/salt/rc.salt-master.new b/system/salt/rc.salt-master.new new file mode 100644 index 0000000000000..d4c851f5a5a04 --- /dev/null +++ b/system/salt/rc.salt-master.new @@ -0,0 +1,49 @@ +#!/bin/sh +# Start/stop/restart salt master + +PIDFILE=/var/run/salt-master.pid +LOGFILE=/var/log/salt/master +# LOGLEVEL: One of: all, garbage, trace, debug, info, warning, error, quiet +LOGLEVEL=warning + +# Start salt-master: +salt_master_start() { + if [ -x /usr/bin/salt-master ]; then + echo "Starting salt-master daemon: /usr/bin/salt-master" + /usr/bin/salt-master -d \ + --pid-file=$PIDFILE \ + --log-file=$LOGFILE \ + --log-file-level=$LOGLEVEL + fi +} + +# Stop salt-master: +salt_master_stop() { + if [ -s $PIDFILE ] ; then + kill $(cat $PIDFILE) + else + killall salt-master + fi + rm -f $PIDFILE +} + +# Restart salt-master: +salt_master_restart() { + salt_master_stop + sleep 1 + salt_master_start +} + +case "$1" in +'start') + salt_master_start + ;; +'stop') + salt_master_stop + ;; +'restart') + salt_master_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac -- cgit v1.2.3