cwsaylor (owner)

Revisions

gist: 17522 Download_button fork
public
Description:
God init.d script
Public Clone URL: git://gist.github.com/17522.git
Embed All Files: show embed
Bash #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/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