Skip to content

Instantly share code, notes, and snippets.

@mamor
Created October 11, 2014 06:11
Show Gist options
  • Save mamor/a346faf7e0370fcce6fa to your computer and use it in GitHub Desktop.
Save mamor/a346faf7e0370fcce6fa to your computer and use it in GitHub Desktop.
init script for supervisord
#!/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