Created
June 14, 2013 22:16
-
-
Save jasonthomas/5785710 to your computer and use it in GitHub Desktop.
circusd init script
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/bash | |
| # | |
| # circusd This scripts turns circusd on | |
| # | |
| # Author: Jason Thomas <jthomas@mozilla.com> | |
| # | |
| # chkconfig: - 95 04 | |
| # | |
| # description: circus is a program that will let you run and watch | |
| # multiple processes and sockets. | |
| # processname: circusd | |
| # config: /etc/circus.ini | |
| # pidfile: /var/run/circusd.pid | |
| # | |
| # source function library | |
| . /etc/rc.d/init.d/functions | |
| CONFIG='/etc/circus.ini' | |
| RETVAL=0 | |
| start() { | |
| echo -n $"Starting circusd: " | |
| daemon circusd $CONFIG --daemon | |
| RETVAL=$? | |
| echo | |
| [ $RETVAL -eq 0 ] && touch /var/lock/subsys/circusd | |
| } | |
| stop() { | |
| echo -n $"Stopping circusd: " | |
| killproc circusd | |
| echo | |
| [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/circusd | |
| } | |
| restart() { | |
| stop | |
| start | |
| } | |
| case "$1" in | |
| start) | |
| start | |
| ;; | |
| stop) | |
| stop | |
| ;; | |
| restart|force-reload|reload) | |
| restart | |
| ;; | |
| condrestart) | |
| [ -f /var/lock/subsys/circusd ] && restart | |
| ;; | |
| status) | |
| status circusd | |
| RETVAL=$? | |
| ;; | |
| *) | |
| echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}" | |
| exit 1 | |
| esac | |
| exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment