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 msg_starting "sensors daemon"; fail
26 nls "BUS or CHIP not configured in /etc/sysconfig/sensors"
32 _modprobe single die "i2c-$i"
35 _modprobe single die "$i"
38 if [ "$SENSORS_SET" = "1" ]; then
42 msg_starting "sensors daemon"
44 $([ -n "$INTERVAL" ] && echo "-i $INTERVAL") \
45 $([ -n "$LOG_INTERVAL" ] && echo "-l $LOG_INTERVAL") \
46 $([ -n "$RRD_LOGFILE" ] && echo "-r $RRD_LOGFILE") \
47 $([ -n "$RRD_INTERVAL" ] && echo "-t $RRD_INTERVAL") \
51 [ $RET -eq 0 ] && touch /var/lock/subsys/sensors
53 msg_already_running "sensors daemon"
56 touch /var/lock/subsys/sensors
59 if [ -f /var/lock/subsys/sensors ]; then
60 msg_stopping "sensors daemon"
63 # remove kernel modules
65 /sbin/rmmod $i >/dev/null 2>&1
68 /sbin/rmmod i2c-$BUS >/dev/null 2>&1
71 rm -f /var/lock/subsys/sensors
73 msg_not_running "sensors daemon"
78 status sensors sensord
86 msg_usage "$0 {start|stop|status|restart}"