3 # alarmwatch watches for lm_sensors alarms
5 # chkconfig: 2345 32 68
7 # description: watches lm_sensors and beeps on aparms
11 # Source function library
12 . /etc/rc.d/init.d/functions
16 PIDFILE=/var/run/alarmwatch.pid
20 # Get service config - may override defaults
21 [ -f /etc/sysconfig/alarmwatch ] && . /etc/sysconfig/alarmwatch
24 # See how we were called.
27 # Check if the service is already running?
28 if [ ! -f /var/lock/subsys/alarmwatch ]; then
29 if [ -z "$CHIPS" ]; then
30 nls "alarmwatch not configured (CHIPS not set), cannot start."
33 if [ "$SENSORS_SETUP" = "yes" ]; then
34 # setup sensors limits, etc.
37 # read from sensors to clear out any alarms caused by previous limits...
39 msg_starting alarmwatch
40 daemon alarmwatch -p "$PIDFILE" $CHIPS $ALARMOPTIONS
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/alarmwatch
44 msg_already_running alarmwatch
49 if [ -f /var/lock/subsys/alarmwatch ]; then
50 msg_stopping alarmwatch
52 rm -f /var/lock/subsys/alarmwatch $PIDFILE
54 msg_not_running alarmwatch
67 msg_usage "$0 {start|stop|restart|force-reload|status}"
73 # This must be last line !
74 # vi:syntax=sh:tw=78:ts=8:sw=4