Created
November 24, 2014 09:38
-
-
Save saily/9371581d0b9e16b90f2c to your computer and use it in GitHub Desktop.
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/bash | |
# | |
# supervisord This scripts turns supervisord on | |
# | |
# Author: Mike McGrath <[email protected]> (based off yumupdatesd) | |
# Jason Koppe <[email protected]> adjusted to read sysconfig, | |
# use supervisord tools to start/stop, conditionally wait | |
# for child processes to shutdown, and startup later | |
# | |
# chkconfig: 345 83 04 | |
# | |
# description: supervisor is a process control utility. It has a web based | |
# xmlrpc interface as well as a few other nifty features. | |
# processname: supervisord | |
# config: ${buildout:parts-directory}/${:_buildout_section_name_}/supervisord.conf | |
# pidfile: ${buildout:directory}/var/supervisord.pid | |
# | |
# Modified to be used as `collective.recipe.template` source by | |
# Daniel Widerin <[email protected]>, 2014-11-24 | |
# | |
# source function library | |
. /etc/rc.d/init.d/functions | |
BUILDOUT_HOME="${buildout:directory}" | |
SUPERVISORD="$BUILDOUT_HOME/bin/supervisord" | |
SUPERVISORCTL="$BUILDOUT_HOME/bin/supervisorctl" | |
RETVAL=0 | |
start() { | |
$SUPERVISORD | |
} | |
stop() { | |
$SUPERVISORCTL shutdown | |
} | |
restart() { | |
$SUPERVISORCTL restart all | |
} | |
status() { | |
$SUPERVISORCTL status | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
status) | |
status | |
;; | |
restart) | |
restart | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|status|restart}" | |
RETVAL=2 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment