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
30 _modprobe single die "i2c-$BUS"
31 _modprobe single die "$CHIP"
33 if [ "$SENSORS_SET" = "1" ]; then
37 msg_starting "sensors daemon"
39 $([ -n "$INTERVAL" ] && echo "-i $INTERVAL") \
40 $([ -n "$LOG_INTERVAL" ] && echo "-l $LOG_INTERVAL") \
44 [ $RET -eq 0 ] && touch /var/lock/subsys/sensors
46 msg_already_running "sensors daemon"
49 touch /var/lock/subsys/sensors
52 if [ -f /var/lock/subsys/sensors ]; then
53 msg_stopping "sensors daemon"
56 # remove kernel modules
57 /sbin/rmmod $CHIP >/dev/null 2>&1
58 /sbin/rmmod i2c-$BUS >/dev/null 2>&1
60 rm -f /var/lock/subsys/sensors
62 msg_not_running "sensors daemon"
75 msg_usage "$0 {start|stop|status|restart}"