3 # sensors: Hardware sensors monitoring daemon
7 # chkconfig: 2345 30 70
8 # description: Starts and stops hardware sensors monitoring daemon.
9 # author: Filip Kalinski <filon@pld.org.pl>
11 # Source function library.
12 . /etc/rc.d/init.d/functions
15 if [ -f /etc/sysconfig/sensors ] ; then
16 . /etc/sysconfig/sensors
21 msg_starting "sensors daemon"
26 # See how we were called.
29 # Check if the service is already running?
30 if [ ! -f /var/lock/subsys/sensors ]; then
31 msg_starting "sensors daemon"
34 # sensors not configured
35 if [ -z "$BUS" ] || [ -z "$CHIP" ]; then
40 _modprobe single die "i2c-$BUS"
41 _modprobe single die "$CHIP"
43 msg_starting "sensors daemon"
45 $([ -n "$INTERVAL" ] && echo "-i $INTERVAL") \
46 $([ -n "$LOG_INTERVAL" ] && echo "-l $LOG_INTERVAL") \
50 [ $RET -eq 0 ] && touch /var/lock/subsys/sensors
52 msg_Already_Running "sensors daemon"
55 touch /var/lock/subsys/sensors
58 if [ -f /var/lock/subsys/sensors ]; then
59 msg_stopping "sensors daemon"
62 # remove kernel modules
63 /sbin/rmmod $CHIP >/dev/null 2>&1
64 /sbin/rmmod i2c-$BUS >/dev/null 2>&1
66 rm -f /var/lock/subsys/sensors
68 msg_Not_Running "sensors daemon"
80 msg_Usage "$0 {start|stop|status|restart}"