Created
January 11, 2014 11:18
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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