]> git.pld-linux.org Git - packages/cpqarrayd.git/blame - cpqarrayd.init
- release 7 (by relup.sh)
[packages/cpqarrayd.git] / cpqarrayd.init
CommitLineData
c6f63125 1#!/bin/sh
e3b4c855
ER
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
c6f63125 10# Source function library
e3b4c855
ER
11. /etc/rc.d/init.d/functions
12
c30ac04c
ER
13CPQ_PARAMS=""
14
e3b4c855
ER
15# Get config.
16if [ -f /etc/sysconfig/cpqarrayd ]; then
c6f63125 17 . /etc/sysconfig/cpqarrayd
e3b4c855
ER
18fi
19
f0303835 20start() {
c6f63125
ER
21 # Check if the service is already running?
22 if [ ! -f /var/lock/subsys/cpqarrayd ]; then
23 msg_starting cpqarrayd
c30ac04c
ER
24 for host in $TRAP_DESTINATIONS; do
25 CPQ_PARAMS="$CPQ_PARAMS -t $host"
26 done
c6f63125
ER
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
f0303835
ER
33}
34
35stop() {
c6f63125
ER
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
f0303835
ER
44}
45
e528e128
JB
46condrestart() {
47 if [ -f /var/lock/subsys/cpqarrayd ]; then
48 stop
49 start
50 else
3045dc8f 51 msg_not_running cpqarrayd
e528e128
JB
52 RETVAL=$1
53 fi
54}
55
f0303835
ER
56RETVAL=0
57# See how we were called.
58case "$1" in
59821751 59 start)
f0303835
ER
60 start
61 ;;
59821751 62 stop)
f0303835 63 stop
c6f63125 64 ;;
59821751 65 restart)
f0303835
ER
66 stop
67 start
c6f63125 68 ;;
59821751 69 try-restart)
e528e128
JB
70 condrestart 0
71 ;;
59821751 72 force-reload)
e528e128
JB
73 condrestart 7
74 ;;
59821751 75 status)
c6f63125
ER
76 status cpqarrayd
77 RETVAL=$?
78 ;;
59821751 79 *)
e528e128 80 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
c6f63125 81 exit 3
e3b4c855
ER
82esac
83
84exit $RETVAL
This page took 0.105231 seconds and 4 git commands to generate.