Created
March 12, 2016 17:51
-
-
Save rtgibbons/21577e74a078e094588d to your computer and use it in GitHub Desktop.
supervisors init script from centos6
This file contains 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) | |
# | |
# chkconfig: - 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/rc.d/init.d/functions | |
RETVAL=0 | |
start() { | |
echo -n $"Starting supervisord: " | |
daemon supervisord | |
RETVAL=$? | |
echo | |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/supervisord | |
} | |
stop() { | |
echo -n $"Stopping supervisord: " | |
killproc supervisord | |
echo | |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/supervisord | |
} | |
restart() { | |
stop | |
start | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart|force-reload|reload) | |
restart | |
;; | |
condrestart) | |
[ -f /var/lock/subsys/supervisord ] && restart | |
;; | |
status) | |
status supervisord | |
RETVAL=$? | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}" | |
exit 1 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment