4e881f9
#!/bin/bash
4e881f9
#
4e881f9
# supervisord   This scripts turns supervisord on
4e881f9
#
4e881f9
# Author:       Mike McGrath <mmcgrath@redhat.com> (based off yumupdatesd)
4e881f9
#
4e881f9
# chkconfig:	- 95 04
4e881f9
#
4e881f9
# description:  supervisor is a process control utility.  It has a web based
4e881f9
#               xmlrpc interface as well as a few other nifty features.
4e881f9
# processname:  supervisord
4e881f9
# config: /etc/supervisord.conf
4e881f9
# pidfile: /var/run/supervisord.pid
4e881f9
#
4e881f9
4e881f9
# source function library
4e881f9
. /etc/rc.d/init.d/functions
4e881f9
4e881f9
RETVAL=0
4e881f9
4e881f9
start() {
4e881f9
	echo -n $"Starting supervisord: "
4e881f9
	daemon supervisord
4e881f9
	RETVAL=$?
4e881f9
	echo
4e881f9
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/supervisord
4e881f9
}
4e881f9
4e881f9
stop() {
4e881f9
	echo -n $"Stopping supervisord: "
4e881f9
	killproc supervisord
4e881f9
	echo
4e881f9
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/supervisord
4e881f9
}
4e881f9
4e881f9
restart() {
4e881f9
	stop
4e881f9
	start
4e881f9
}
4e881f9
4e881f9
case "$1" in
4e881f9
  start)
4e881f9
	start
4e881f9
	;;
4e881f9
  stop) 
4e881f9
	stop
4e881f9
	;;
4e881f9
  restart|force-reload|reload)
4e881f9
	restart
4e881f9
	;;
4e881f9
  condrestart)
4e881f9
	[ -f /var/lock/subsys/supervisord ] && restart
4e881f9
	;;
4e881f9
  status)
4e881f9
	status supervisord
4e881f9
	RETVAL=$?
4e881f9
	;;
4e881f9
  *)
4e881f9
	echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
4e881f9
	exit 1
4e881f9
esac
4e881f9
4e881f9
exit $RETVAL