Skip to content

Instantly share code, notes, and snippets.

@ihor
Last active January 19, 2018 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihor/3829571 to your computer and use it in GitHub Desktop.
Save ihor/3829571 to your computer and use it in GitHub Desktop.
/etc/init.d/supervisor script for Homebrew installed Supervisor
#!/bin/bash
DAEMON=/usr/local/bin/supervisord
OPTS='-c /usr/local/etc/supervisor/supervisord.conf'
NAME=supervisor
DESC=supervisor
test -x $DAEMON || exit 0
set -e
start()
{
$DAEMON $OPTS > /dev/null 2>&1 &
return
}
stop()
{
kill -SIGQUIT `cat /usr/local/var/run/supervisord.pid`
return
}
case "$1" in
start)
echo -n "Starting $DESC: "
start
echo "started."
;;
stop)
echo -n "Stopping $DESC: "
stop
echo "stopped."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
stop
sleep 1
start
echo "restarted."
;;
reload)
echo -n "Reloading $DESC: "
kill -SIGHUP `cat /usr/local/var/run/supervisord.pid`
echo "reloaded."
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|reload}" >&2
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment