root/resources/resmon_redhat_rc

Revision 500d40131f207aa18d395e41a6b731f6182ec669, 1.4 kB (checked in by Jason Dixon <jdixon@omniti.com>, 4 years ago)

call by explicit path, allows resmon/resmon2 running in parallel

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

  • Property mode set to 100755
Line 
1 #!/bin/bash
2 #
3 # resmon2       Starts resmon2.
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: $resmon2
11 ### END INIT INFO
12
13 # Source function library.
14 . /etc/init.d/functions
15
16 RESMON_DIR=/opt/resmon2
17 RESMON_CONF=$RESMON_DIR/resmon.conf
18 RESMON_BIN=$RESMON_DIR/resmon
19 RESMON_LOCK=/var/lock/subsys/resmon2
20
21 [ -f $RESMON_BIN ] || exit 0
22 [ -f $RESMON_CONF ] || exit 0
23
24 RETVAL=0
25
26 umask 077
27
28 start() {
29         echo -n $"Starting resmon2: "
30         daemon $RESMON_BIN
31         RETVAL=$?
32         echo
33         [ $RETVAL -eq 0 ] && touch $RESMON_LOCK
34         return $RETVAL
35 }
36 stop() {
37         echo -n $"Shutting down resmon2: "
38         killproc $RESMON_BIN
39         echo
40         RETVAL=$?
41         [ $RETVAL -eq 0 ] && rm -f $RESMON_LOCK
42         return $RETVAL
43 }
44 rhstatus() {
45         status resmon2
46 }
47 restart() {
48         stop
49         start
50 }
51 reload() {
52         echo -n $"Reloading resmon2: "
53         killproc $RESMON_BIN -HUP
54         echo
55         return $?
56 }
57
58 case "$1" in
59   start)
60         start
61         ;;
62   stop)
63         stop
64         ;;
65   status)
66         rhstatus
67         ;;
68   restart)
69         restart
70         ;;
71   reload)
72         reload
73         ;;
74   condrestart)
75         [ -f $RESMON_LOCK ] && restart || :
76         ;;
77   *)
78         echo $"Usage: $0 {start|stop|status|restart|condrestart}"
79         exit 1
80 esac
81
82 exit $?
83
Note: See TracBrowser for help on using the browser.