Created
December 2, 2011 17:26
-
-
Save mactkg/1424071 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 | |
# | |
# chkconfig: 2345 95 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: /etc/supervisord.conf | |
# pidfile: /var/run/supervisord.pid | |
# | |
# source function library | |
. /etc/init.d/functions | |
RETVAL=0 | |
prog='supervisord' | |
supervisord='/usr/local/bin/supervisord' | |
pidfile='/var/run/supervisord.pid' | |
configfile='/etc/supervisord.conf' | |
start() { | |
echo -n $"Starting $prog: " | |
daemon $supervisord --pidfile $pidfile -c $configfile | |
RETVAL=$? | |
echo | |
return $RETVAL | |
} | |
stop() { | |
echo -n $"Stopping $prog: " | |
killproc -p $pidfile $supervisord | |
RETVAL=$? | |
echo | |
} | |
reload() { | |
echo -n $"Reloading $prog: " | |
killproc -p $pidfile $supervisord -HUP | |
RETVAL=$? | |
echo | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
reload) | |
reload | |
;; | |
status) | |
status -p $pidfile $supervisord | |
RETVAL=$? | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart|reload|status}" | |
exit 1 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment