Skip to content

Instantly share code, notes, and snippets.

@nek023
Created January 11, 2014 11:18
Show Gist options
  • Select an option

  • Save nek023/8369689 to your computer and use it in GitHub Desktop.

Select an option

Save nek023/8369689 to your computer and use it in GitHub Desktop.
chkconfig script for supervisor (put this script on /etc/rc.d/init.d/supervisord) http://yosida95.hatenablog.com/entry/20120322/1332439575
#!/bin/sh
# chkconfig: - 15 15
# description: Copyright (C) yosida95 All Right Reserved.
. /etc/rc.d/init.d/functions
SUPERVISORD="/usr/bin/supervisord"
PIDFILE="/var/run/supervisord.pid"
start() {
if [ ! -x "$SUPERVISORD" ]; then
echo "$SUPERVISORD is not executable."
exit 1
fi
echo "Starting ..."
$SUPERVISORD --pidfile $PIDFILE
return $?
}
stop() {
echo "Stopping ..."
kill -QUIT `cat $PIDFILE`
[ $? -eq 0 ] && rm -f $PIDFILE
return $retval
}
case $1 in
start)
start
;;
stop)
stop
;;
*)
echo "$0 start|srop"
exit 2
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment