Created
December 28, 2011 23:28
-
-
Save Gurpartap/1530414 to your computer and use it in GitHub Desktop.
/etc/init.d/god
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 | |
# | |
# god Startup script for god (http://god.rubyforge.org) | |
# | |
# chkconfig: - 85 15 | |
# description: God is an easy to configure, easy to extend monitoring \ | |
# framework written in Ruby. | |
# | |
CONF_DIR=/usr/local/god | |
GOD_BIN=/usr/local/bin/god | |
RUBY_BIN=/usr/local/bin/ruby | |
RETVAL=0 | |
# Go no further if config directory is missing. | |
[ -d "$CONF_DIR" ] || exit 0 | |
case "$1" in | |
start) | |
# Create pid directory | |
$RUBY_BIN $GOD_BIN -c $CONF_DIR/master.conf | |
RETVAL=$? | |
;; | |
stop) | |
$RUBY_BIN $GOD_BIN terminate | |
RETVAL=$? | |
;; | |
restart) | |
$RUBY_BIN $GOD_BIN terminate | |
$RUBY_BIN $GOD_BIN -c $CONF_DIR/master.conf | |
RETVAL=$? | |
;; | |
status) | |
$RUBY_BIN $GOD_BIN status | |
RETVAL=$? | |
;; | |
*) | |
echo "Usage: god {start|stop|restart|status}" | |
exit 1 | |
;; | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment