Skip to content

Instantly share code, notes, and snippets.

@muke5hy
Created August 5, 2016 11:30
Show Gist options
  • Select an option

  • Save muke5hy/488a0d39078e938072f411953c1cb9e9 to your computer and use it in GitHub Desktop.

Select an option

Save muke5hy/488a0d39078e938072f411953c1cb9e9 to your computer and use it in GitHub Desktop.
supervisord daemon for CentOS
#!/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="/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
@muke5hy
Copy link
Copy Markdown
Author

muke5hy commented Aug 5, 2016

sudo curl
To enable do following

https://gist.githubusercontent.com/muke5hy/488a0d39078e938072f411953c1cb9e9/raw/43ee9441b5057268719a0ab832d9b6dd74afa5fc/supervisord > /etc/init.d/supervisord

sudo chmod +x /etc/init.d/supervisord # Give permission

sudo chkconfig --add supervisord # Auto Start

sudo service supervisord stop
sudo service supervisord start

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