Skip to content

Instantly share code, notes, and snippets.

@rhybroy
Forked from anonymous/supervisord
Created July 23, 2013 14:24
Show Gist options
  • Save rhybroy/6062746 to your computer and use it in GitHub Desktop.
Save rhybroy/6062746 to your computer and use it in GitHub Desktop.
#!/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"
prog_bin="/usr/local/bin/supervisord"
PIDFILE="/var/run/$prog.pid"
start()
{
echo -n $"Starting $prog: "
daemon $prog_bin --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
@rhybroy
Copy link
Author

rhybroy commented Jul 23, 2013

must make sure prog_bin&pidfile correct
mv supervisord /etc/rc.d/init.d/supervisord
chmod +x /etc/rc.d/init.d/supervisord
chkconfig --add supervisord
chkconfig supervisord on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment