#!/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="${prefix}" prog_bin="${exec_prefix}/bin/supervisord" PIDFILE="/tmp/supervisord.pid" LOCKFILE="/var/lock/subsys/$prog" CONFIGFILE="/etc/supervisord.conf" start() { echo -n $"Starting $prog: " daemon --pidfile $PIDFILE $prog_bin -c $CONFIGFILE retval=$? echo [ $retval -eq 0 ] && touch $LOCKFILE && [ -f $PIDFILE ] return $retval } stop() { echo -n $"Shutting down $prog: " killproc -p $PIDFILE $prog_bin || success $"$prog shutdown" retval=$? echo if [ $retval -eq 0 ] ; then rm -f $LOCKFILE $PIDFILE fi } case "$1" in start) start ;; stop) stop ;; status) status $prog ;; restart) stop start ;; *) echo "Usage: $0 {start|stop|restart|status}" ;; esac