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
20 # See how we were called.
23 # Check if the service is already running?
24 if [ ! -f /var/lock/subsys/sensors ]; then
25 if [ -z "$BUS" ] || [ -z "$CHIP" ]; then
26 msg_starting "sensors daemon"; fail
27 nls "BUS or CHIP not configured in /etc/sysconfig/sensors" >&2
33 _modprobe single die "i2c-$i"
36 _modprobe single die "$i"
39 if [ "$SENSORS_SET" = "1" ]; then
43 msg_starting "sensors daemon"
45 $([ -n "$INTERVAL" ] && echo "-i $INTERVAL") \
46 $([ -n "$LOG_INTERVAL" ] && echo "-l $LOG_INTERVAL") \
47 $([ -n "$RRD_LOGFILE" ] && echo "-r $RRD_LOGFILE") \
48 $([ -n "$RRD_INTERVAL" ] && echo "-t $RRD_INTERVAL") \
52 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sensors
53 touch /var/lock/subsys/sensors
55 msg_already_running "sensors daemon"
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"
77 status sensors sensord
87 msg_usage "$0 {start|stop|restart|force-reload|status}"