Skip to content

Instantly share code, notes, and snippets.

@mactkg
Created December 2, 2011 17:25
Show Gist options
  • Save mactkg/1424068 to your computer and use it in GitHub Desktop.
Save mactkg/1424068 to your computer and use it in GitHub Desktop.
#!/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