]> git.pld-linux.org Git - packages/cpqarrayd.git/blob - cpqarrayd.init
e63d8a0510a13c68e4d02699359ab01959757e21
[packages/cpqarrayd.git] / cpqarrayd.init
1 #!/bin/sh
2 #
3 # cpqarrayd    Start/Stop Compaq Array monitor
4 #
5 # chkconfig: 345 15 90
6 # description: The cpqarrayd monitors the status of Compaq Raid Arrays, \
7 #              and reports via syslog or traps
8 # processname: cpqarrayd
9
10 # Source function library
11 . /etc/rc.d/init.d/functions
12
13 CPQ_PARAMS=""
14
15 # Get config.
16 if [ -f /etc/sysconfig/cpqarrayd ]; then
17         . /etc/sysconfig/cpqarrayd
18 fi
19
20 start() {
21         # Check if the service is already running?
22         if [ ! -f /var/lock/subsys/cpqarrayd ]; then
23                 msg_starting cpqarrayd
24                 for host in $TRAP_DESTINATIONS; do
25                         CPQ_PARAMS="$CPQ_PARAMS -t $host"
26                 done
27                 daemon cpqarrayd $CPQ_PARAMS
28                 RETVAL=$?
29                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cpqarrayd
30         else
31                 msg_already_running cpqarrayd
32         fi
33 }
34
35 stop() {
36         if [ -f /var/lock/subsys/cpqarrayd ]; then
37                 # Stop daemons.
38                 msg_stopping cpqarrayd
39                 killproc cpqarrayd
40                 rm -f /var/lock/subsys/cpqarrayd
41         else
42                 msg_not_running cpqarrayd
43         fi
44 }
45
46 RETVAL=0
47 # See how we were called.
48 case "$1" in
49 start)
50         start
51         ;;
52 stop)
53         stop
54         ;;
55 restart|force-reload)
56         stop
57         start
58         ;;
59 status)
60         status cpqarrayd
61         RETVAL=$?
62         ;;
63 *)
64         msg_usage "$0 {start|stop|restart|force-reload|status}"
65         exit 3
66 esac
67
68 exit $RETVAL
This page took 0.072944 seconds and 3 git commands to generate.