3 # sensors: Hardware sensors monitoring daemon
7 # chkconfig: 2345 32 68
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
19 # See how we were called.
22 # Check if the service is already running?
23 if [ ! -f /var/lock/subsys/sensors ]; then
24 if [ -z "$BUS" ] || [ -z "$CHIP" ]; then
25 # sensors not configured
31 _modprobe single die "i2c-$i"
34 _modprobe single die "$i"
37 if [ "$SENSORS_SET" = "1" ]; then
41 msg_starting "sensors daemon"
43 $([ -n "$INTERVAL" ] && echo "-i $INTERVAL") \
44 $([ -n "$LOG_INTERVAL" ] && echo "-l $LOG_INTERVAL") \
48 [ $RET -eq 0 ] && touch /var/lock/subsys/sensors
50 msg_already_running "sensors daemon"
53 touch /var/lock/subsys/sensors
56 if [ -f /var/lock/subsys/sensors ]; then
57 msg_stopping "sensors daemon"
60 # remove kernel modules
62 /sbin/rmmod $i >/dev/null 2>&1
65 /sbin/rmmod i2c-$BUS >/dev/null 2>&1
68 rm -f /var/lock/subsys/sensors
70 msg_not_running "sensors daemon"
83 msg_usage "$0 {start|stop|status|restart}"