Created
September 11, 2012 08:04
-
-
Save theDisco/3696809 to your computer and use it in GitHub Desktop.
init.d 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/bash -e | |
# Taken and corrected from: | |
# http://paste.roguecoders.com/p/ff16aa631b84c579033e10fb7d49deb6.txt | |
SUPERVISORD=/usr/local/bin/supervisord | |
PIDFILE=/var/run/supervisord.pid | |
OPTS="-c /etc/supervisord/supervisord.conf" | |
test -x $SUPERVISORD || exit 0 | |
. /lib/lsb/init-functions | |
export PATH="${PATH:+$PATH:}/usr/local/bin:/usr/sbin:/sbin" | |
case "$1" in | |
start) | |
log_begin_msg "Starting Supervisor daemon manager..." | |
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $SUPERVISORD -- $OPTS || log_end_msg 1 | |
log_end_msg 0 | |
;; | |
stop) | |
log_begin_msg "Stopping Supervisor daemon manager..." | |
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE || log_end_msg 1 | |
log_end_msg 0 | |
;; | |
restart|reload|force-reload) | |
log_begin_msg "Restarting Supervisor daemon manager..." | |
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE | |
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $SUPERVISORD -- $OPTS || log_end_msg 1 | |
log_end_msg 0 | |
;; | |
*) | |
log_success_msg "Usage: /etc/init.d/supervisor | |
{start|stop|reload|force-reload|restart}" | |
exit 1 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment