root/rc/resmon

Revision 4a0f8e27e18b7e4937e6f050f8f29a5619f55c5a, 1.0 kB (checked in by Brian Holcomb <holcomb@omniti.com>, 6 years ago)

redhat flavored init script for resmon

git-svn-id: https://labs.omniti.com/resmon/trunk@64 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
47 case "$1" in
48   start)
49         start
50         ;;
51   stop)
52         stop
53         ;;
54   status)
55         rhstatus
56         ;;
57   restart|reload)
58         restart
59         ;;
60   condrestart)
61         [ -f /var/lock/subsys/resmon ] && restart || :
62         ;;
63   *)
64         echo $"Usage: $0 {start|stop|status|restart|condrestart}"
65         exit 1
66 esac
67
68 exit $?
69
Note: See TracBrowser for help on using the browser.