Skip to content

Instantly share code, notes, and snippets.

@cwsaylor
Created October 17, 2008 20:46
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cwsaylor/17522 to your computer and use it in GitHub Desktop.
God init.d script
#!/bin/bash
#
# god Startup script for God monitoring tool.
#
# chkconfig: - 85 15
# description: god monitors your system
#
CONF_DIR=/etc/god/*
PID=/var/run/god.pid
LOG=/var/log/god.log
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RETVAL=0
case "$1" in
start)
god -P $PID --no-syslog # -l $LOG --log-level warn
god load $CONF_DIR
RETVAL=$?
;;
stop)
kill `cat $PID`
RETVAL=$?
;;
restart)
kill `cat $PID`
god -P $PID --no-syslog # -l $LOG --log-level warn
god load $CONF_DIR
RETVAL=$?
;;
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