Last active
December 14, 2016 13:13
-
-
Save wakwanza/81127651a1b648b828594d5746248a47 to your computer and use it in GitHub Desktop.
Supervisord init.d script
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/sh | |
# | |
# /etc/rc.d/init.d/supervisord | |
# | |
# Supervisor is a client/server system that | |
# allows its users to monitor and control a | |
# number of processes on UNIX-like operating | |
# systems. | |
# | |
# chkconfig: - 64 36 | |
# description: Supervisor Server | |
# processname: supervisord | |
# Source init functions | |
. /etc/rc.d/init.d/functions | |
prog="supervisord" | |
#prefix="/usr" | |
exec_prefix="/usr" | |
prog_bin="${exec_prefix}/bin/supervisord" | |
#prog_bin=`which $prog` | |
CONF="/etc/supervisord.conf" | |
PIDFILE="/var/run/$prog.pid" | |
start() | |
{ | |
echo -n $"Starting $prog: " | |
daemon $prog_bin -c $CONF --pidfile $PIDFILE | |
[ -f $PIDFILE ] && success $"$prog startup" || failure $"$prog startup" | |
echo | |
} | |
stop() | |
{ | |
echo -n $"Shutting down $prog: " | |
[ -f $PIDFILE ] && killproc $prog || success $"$prog shutdown" | |
echo | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
status) | |
status $prog | |
;; | |
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