]> git.pld-linux.org Git - packages/cpqarrayd.git/blob - cpqarrayd.init
- add trap destinations param
[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 RETVAL=0
21 # See how we were called.
22 case "$1" in
23 start)
24         # Check if the service is already running?
25         if [ ! -f /var/lock/subsys/cpqarrayd ]; then
26                 msg_starting cpqarrayd
27                 for host in $TRAP_DESTINATIONS; do
28                         CPQ_PARAMS="$CPQ_PARAMS -t $host"
29                 done
30                 daemon cpqarrayd $CPQ_PARAMS
31                 RETVAL=$?
32                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cpqarrayd
33         else
34                 msg_already_running cpqarrayd
35         fi
36         ;;
37 stop)
38         if [ -f /var/lock/subsys/cpqarrayd ]; then
39                 # Stop daemons.
40                 msg_stopping cpqarrayd
41                 killproc cpqarrayd
42                 rm -f /var/lock/subsys/cpqarrayd
43         else
44                 msg_not_running cpqarrayd
45         fi
46         ;;
47 restart|reload|force-reload)
48         $0 stop
49         $0 start
50         RETVAL=$?
51         ;;
52 status)
53         status cpqarrayd
54         RETVAL=$?
55         ;;
56 *)
57         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
58         exit 3
59 esac
60
61 exit $RETVAL
This page took 0.075771 seconds and 3 git commands to generate.