#!/bin/sh # # cpqarrayd Start/Stop Compaq Array monitor # # chkconfig: 345 15 90 # description: The cpqarrayd monitors the status of Compaq Raid Arrays, \ # and reports via syslog or traps # processname: cpqarrayd # Source function library . /etc/rc.d/init.d/functions CPQ_PARAMS="" # Get config. if [ -f /etc/sysconfig/cpqarrayd ]; then . /etc/sysconfig/cpqarrayd fi RETVAL=0 # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/cpqarrayd ]; then msg_starting cpqarrayd for host in $TRAP_DESTINATIONS; do CPQ_PARAMS="$CPQ_PARAMS -t $host" done daemon cpqarrayd $CPQ_PARAMS RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cpqarrayd else msg_already_running cpqarrayd fi ;; stop) if [ -f /var/lock/subsys/cpqarrayd ]; then # Stop daemons. msg_stopping cpqarrayd killproc cpqarrayd rm -f /var/lock/subsys/cpqarrayd else msg_not_running cpqarrayd fi ;; restart|force-reload) $0 stop $0 start RETVAL=$? ;; status) status cpqarrayd RETVAL=$? ;; *) msg_usage "$0 {start|stop|restart|force-reload|status}" exit 3 esac exit $RETVAL