root/resources/resmon

Revision 55d147a142682fdd848a6aab523e290d8a8a39b9, 1.3 kB (checked in by Mark Harrison <mark@omniti.com>, 4 years ago)

Formatting fixes for rc script

git-svn-id: https://labs.omniti.com/resmon/trunk@253 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

  • Property mode set to 100755
Line 
1 #!/bin/bash
2 #
3 # resmon        Starts resmon.
4 #
5 #
6 # chkconfig: 2345 99 01
7 # description: resmon is a systems monitoring facility to aid nagios \
8 # checks.  it should always be running when the system is in operation.
9 ### BEGIN INIT INFO
10 # Provides: $resmon
11 ### END INIT INFO
12
13 # Source function library.
14 . /etc/init.d/functions
15
16 [ -f /opt/resmon/resmon ] || exit 0
17 [ -f /opt/resmon/resmon.conf ] || exit 0
18
19 RETVAL=0
20
21 umask 077
22
23 start() {
24         echo -n $"Starting resmon: "
25         daemon /opt/resmon/resmon
26         RETVAL=$?
27         echo
28         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/resmon
29         return $RETVAL
30 }
31 stop() {
32         echo -n $"Shutting down resmon: "
33         killproc resmon
34         echo
35         RETVAL=$?
36         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/resmon
37         return $RETVAL
38 }
39 rhstatus() {
40         status resmon
41 }
42 restart() {
43         stop
44         start
45 }
46 reload() {
47         echo -n $"Reloading resmon: "
48         killproc resmon -HUP
49         echo
50         return $?
51 }
52
53 case "$1" in
54   start)
55         start
56         ;;
57   stop)
58         stop
59         ;;
60   status)
61         rhstatus
62         ;;
63   restart)
64         restart
65         ;;
66   reload)
67         reload
68         ;;
69   condrestart)
70         [ -f /var/lock/subsys/resmon ] && restart || :
71         ;;
72   *)
73         echo $"Usage: $0 {start|stop|status|restart|condrestart}"
74         exit 1
75 esac
76
77 exit $?
78
Note: See TracBrowser for help on using the browser.