Last active
December 11, 2015 23:58
-
-
Save garthk/4680681 to your computer and use it in GitHub Desktop.
`init.d` script for Puppet Dashboard worker processes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: dashboard-workers | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: dashboard workers | |
# Description: Start dashboard-workers daemon placed in /etc/init.d. | |
### END INIT INFO | |
SCRIPTNAME=/etc/init.d/dashboard-workers | |
case "$1" in | |
start) | |
;; | |
stop) | |
;; | |
status) | |
STOPCOUNT=$(/bin/su dashboard -s /bin/sh -c "/usr/bin/env RAILS_ENV=production /usr/share/puppet-dashboard/script/delayed_job -p dashboard -n 4 -m status" | grep "no instances" | wc -l) | |
case $STOPCOUNT in | |
0) | |
echo running | |
exit 0 | |
;; | |
*) | |
echo not running | |
exit 3 | |
;; | |
esac | |
;; | |
restart) | |
;; | |
*) | |
echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2 | |
exit 3 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, huh. The Puppet Labs APT repo
.deb
for puppet-dashboard includes an init.d script, but it doesn't end up deployed on my systems. Investigating…