Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#! /bin/sh## apcupsd This shell script takes care of starting and stopping# the apcupsd UPS monitoring daemon.## chkconfig: - 60 99# description: apcupsd monitors power and takes action if necessary#### BEGIN INIT INFO# Provides: apcupsd# Required-Start: $syslog $local_fs# Required-Stop: $syslog $local_fs# Default-Start:# Default-Stop: 0 1 6# Short-Description: apcupsd daemon# Description: APC UPS Power Control Daemon for Linux### END INIT INFOAPCPID=/var/run/apcupsd.pid# Source function libarary. /etc/rc.d/init.d/functionscase "$1" instart)rm -f /etc/apcupsd/powerfailgrep -q 'POWER FAILURE' /etc/nologin && rm -f /etc/nologinecho -n "Starting UPS monitoring:"daemon /sbin/apcupsd -f /etc/apcupsd/apcupsd.confRETVAL=$?echo[ $RETVAL -eq 0 ] && touch /var/lock/subsys/apcupsd;;stop)echo -n "Shutting down UPS monitoring:"killproc apcupsdechorm -f $APCPIDrm -f /var/lock/subsys/apcupsd;;restart|force-reload)$0 stop$0 start;;condrestart)[ -f /var/lock/subsys/apcupsd ] && $0 restart || :;;reload)echo "$0: reload not implemented"exit 3;;status)status apcupsdRETVAL=$?if [ $RETVAL -eq 0 ]then/sbin/apcaccess statuselseexit $RETVALfi;;*)echo "Usage: $0 {start|stop|restart|condrestart|status}"exit 1;;esacexit 0