File: god

package info (click to toggle)
god 0.7.18-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 888 kB
  • ctags: 953
  • sloc: ruby: 5,516; ansic: 241; makefile: 128; sh: 27
file content (42 lines) | stat: -rwxr-xr-x 808 bytes parent folder | download | duplicates (2)
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
41
42
#!/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=/etc/god

RETVAL=0

# Go no further if config directory is missing.
[ -d "$CONF_DIR" ] || exit 0

case "$1" in
    start)
      # Create pid directory
      ruby /usr/bin/god -c $CONF_DIR/master.conf
      RETVAL=$?
  ;;
    stop)
      ruby /usr/bin/god terminate
      RETVAL=$?
  ;;
    restart)
      ruby /usr/bin/god terminate
      ruby /usr/bin/god -c $CONF_DIR/master.conf
      RETVAL=$?
  ;;
    status)
      ruby /usr/bin/god status
      RETVAL=$?
  ;;
    *)
      echo "Usage: god {start|stop|restart|status}"
      exit 1
  ;;
esac      

exit $RETVAL