]> git.pld-linux.org Git - packages/cpqarrayd.git/blob - cpqarrayd.init
- release 7 (by relup.sh)
[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 condrestart() {
47         if [ -f /var/lock/subsys/cpqarrayd ]; then
48                 stop
49                 start
50         else
51                 msg_not_running cpqarrayd
52                 RETVAL=$1
53         fi
54 }
55
56 RETVAL=0
57 # See how we were called.
58 case "$1" in
59   start)
60         start
61         ;;
62   stop)
63         stop
64         ;;
65   restart)
66         stop
67         start
68         ;;
69   try-restart)
70         condrestart 0
71         ;;
72   force-reload)
73         condrestart 7
74         ;;
75   status)
76         status cpqarrayd
77         RETVAL=$?
78         ;;
79   *)
80         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
81         exit 3
82 esac
83
84 exit $RETVAL
This page took 0.075784 seconds and 3 git commands to generate.