puppet-storyboard/templates/storyboard-workers.sh.erb
Michael Krotscheck 3a5c3825b8 Added command path to puppet-storyboard
This provides the full path to storyboard-worker-daemon to
our sysvinit script.

Change-Id: Iae0606d3a0b6b8ca211fc50232c631238ca80e50
2014-10-03 14:04:13 -07:00

67 lines
1.2 KiB
Plaintext

#!/bin/sh
### BEGIN INIT INFO
# Provides: storyboard-workers
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: StoryBoard Deferred Processors
#### END INIT INFO
NAME=storyboard-workers
USER=<%= scope.lookupvar("storyboard::params::user") %>
GROUP=<%= scope.lookupvar("storyboard::params::group") %>
CMD_DIR="/usr/local/bin"
CMD="storyboard-worker-daemon"
CMD_ARGS="--worker-count <%= @worker_count %>"
########## Common
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:$PATH
SSD=start-stop-daemon
PID=/var/run/${NAME}.pid
start () {
echo -n "Start $NAME"
$SSD --start --pidfile $PID --make-pidfile -u $USER -g $GROUP --background --exec "$CMD_DIR/$CMD" -- $CMD_ARGS
RETVAL=$?
echo
return $RETVAL
}
stop () {
echo -n "Stop $NAME"
$SSD --stop --oknodo --pidfile $PID --signal INT
RETVAL=$?
echo
return $RETVAL
}
restart () {
stop
sleep 1
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
echo "not supported"
;;
restart)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $RETVAL