Last active
August 29, 2015 14:04
-
-
Save inokappa/090dbd88a26d6d85e01d to your computer and use it in GitHub Desktop.
supervisord を起動する init スクリプト
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 | |
# | |
# /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/init.d/functions | |
RETVAL=0 | |
prog="supervisord" | |
pidfile="/tmp/supervisord.pid" | |
lockfile="/var/lock/subsys/supervisord" | |
start() | |
{ | |
echo -n $"Starting $prog: " | |
daemon --pidfile $pidfile /usr/bin/supervisord -c /etc/supervisord.conf | |
RETVAL=$? | |
echo | |
[ $RETVAL -eq 0 ] && touch ${lockfile} | |
} | |
stop() | |
{ | |
echo -n $"Shutting down $prog: " | |
killproc -p ${pidfile} /usr/bin/supervisord | |
RETVAL=$? | |
echo | |
if [ $RETVAL -eq 0 ] ; then | |
rm -f ${lockfile} ${pidfile} | |
fi | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
status) | |
status $prog | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart|status}" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こちらを参考。