Skip to content

Instantly share code, notes, and snippets.

@Psli
Created June 12, 2011 14:09
Show Gist options
  • Save Psli/1021584 to your computer and use it in GitHub Desktop.
Save Psli/1021584 to your computer and use it in GitHub Desktop.
/etc/init.d/god
#!/bin/bash
#
# God
#
# chkconfig: - 85 15
# description: start, stop, restart God
# sudo chmod a+x /etc/init.d/god
# sudo chkconfig --add god
# sudo chkconfig --level 345 god on
RETVAL=0
case "$1" in
start)
/usr/local/bin/god -P /var/run/god.pid -l /var/log/god.log && /usr/local/bin/god load /etc/god.conf
RETVAL=$?
;;
stop)
kill `cat /var/run/god.pid`
RETVAL=$?
;;
restart)
kill `cat /var/run/god.pid`
/usr/local/bin/god -P /var/run/god.pid -l /var/log/god.log && /usr/local/bin/god load /etc/god.conf
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