]> git.pld-linux.org Git - packages/lm_sensors.git/blobdiff - sensors.init
- added RRD example
[packages/lm_sensors.git] / sensors.init
index 34efae9fef71fcc33cbc785f7deacc7101ee1327..bbcd7d565fdb5b34154cccced048400a83947fe5 100644 (file)
@@ -22,13 +22,18 @@ case "$1" in
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/sensors ]; then
                if [ -z "$BUS" ] || [ -z "$CHIP" ]; then 
-                       # sensors not configured                
+                       msg_starting "sensors daemon"; fail
+                       nls "BUS or CHIP not configured in /etc/sysconfig/sensors"
                        exit 1
                fi
                
                # insert modules
-               _modprobe single die "$BUS"
-               _modprobe single die "i2c-$CHIP"
+               for i in $BUS; do
+                       _modprobe single die "i2c-$i"
+               done
+               for i in $CHIP; do
+                       _modprobe single die "$i"
+               done
 
                if [ "$SENSORS_SET" = "1" ]; then
                        sensors -s
@@ -38,6 +43,8 @@ case "$1" in
                daemon sensord \
                        $([ -n "$INTERVAL" ] && echo "-i $INTERVAL") \
                        $([ -n "$LOG_INTERVAL" ] && echo "-l $LOG_INTERVAL") \
+                       $([ -n "$RRD_LOGFILE" ] && echo "-r $RRD_LOGFILE") \
+                       $([ -n "$RRD_INTERVAL" ] && echo "-t $RRD_INTERVAL") \
                        -f daemon
                
                RET=$?
@@ -54,8 +61,12 @@ case "$1" in
                killproc sensord
                
                # remove kernel modules
-               /sbin/rmmod i2c-$CHIP >/dev/null 2>&1 
-               /sbin/rmmod $BUS >/dev/null 2>&1 
+               for i in $CHIP; do
+                       /sbin/rmmod $i >/dev/null 2>&1
+               done
+               for i in $BUS; do
+                       /sbin/rmmod i2c-$BUS >/dev/null 2>&1
+               done
                
                rm -f /var/lock/subsys/sensors
        else
@@ -64,7 +75,7 @@ case "$1" in
        fi
        ;;
   status)
-       status sensord
+       status sensors sensord
        sensors
        ;;
   restart)
This page took 0.066733 seconds and 4 git commands to generate.