Created
October 11, 2014 06:12
-
-
Save mamor/87b08d140cb7fa8214ac to your computer and use it in GitHub Desktop.
init script for supervisord
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/sh | |
# | |
# /etc/rc.d/init.d/supervisord | |
# sudo chkconfig --add supervisord | |
# sudo chkconfig --level 35 supervisord on | |
# | |
# chkconfig: - 64 36 | |
# description: Supervisor Server | |
# processname: supervisord | |
. /etc/rc.d/init.d/functions | |
NAME="supervisord" | |
COMMAND="/usr/bin/supervisord" | |
PIDFILE="/var/run/$NAME.pid" | |
CONFIG="/etc/supervisord.conf" | |
start() | |
{ | |
echo -n $"Starting $NAME: " | |
daemon $COMMAND -c $CONFIG --pidfile $PIDFILE | |
[ -f $PIDFILE ] && success $"$NAME startup" | |
echo | |
} | |
stop() | |
{ | |
echo -n $"Shutting down $NAME: " | |
[ -f $PIDFILE ] && killproc $NAME || success $"$NAME shutdown" | |
echo | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
status) | |
status $NAME | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart|status}" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment