]> git.pld-linux.org Git - packages/lm_sensors.git/commitdiff
- use lm_sensors init script and config generated by sensors-detect
authorJan Rękorajski <baggins@pld-linux.org>
Wed, 18 Apr 2012 11:32:33 +0000 (11:32 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  instead of our crappy invention

Changed files:
    lm_sensors.init -> 1.1
    lm_sensors.sysconfig -> 1.1
    sensors_modules.init -> 1.5
    sensors_modules.sysconfig -> 1.3

lm_sensors.init [new file with mode: 0644]
lm_sensors.sysconfig [new file with mode: 0644]
sensors_modules.init [deleted file]
sensors_modules.sysconfig [deleted file]

diff --git a/lm_sensors.init b/lm_sensors.init
new file mode 100644 (file)
index 0000000..f4c0e32
--- /dev/null
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# chkconfig:   2345 26 74
+# description: sensors is used for monitoring motherboard sensor values.
+# config:      /etc/sysconfig/lm_sensors
+#
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Get service config
+if [ -f /etc/sysconfig/lm_sensors ]; then
+       . /etc/sysconfig/lm_sensors
+fi
+
+start() {
+       if [ -z "$HWMON_MODULES" ]; then
+               nls "lm_sensors: not configured, run sensors-detect"
+               exit 6
+       fi
+
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/lm_sensors ]; then
+               msg_already_running "lm_sensors"
+               return
+       fi
+       for module in $BUS_MODULES $HWMON_MODULES ; do
+               _modprobe single $module
+       done
+       sensors -s
+       touch /var/lock/subsys/lm_sensors
+}
+
+stop() {
+       if [ -z "$HWMON_MODULES" ]; then
+               nls "lm_sensors: not configured, run sensors-detect"
+               exit 6
+       fi
+
+       if [ ! -f /var/lock/subsys/lm_sensors ]; then
+               msg_not_running
+               return
+       fi
+       msg_stopping "lm_sensors"
+       for module in $HWMON_MODULES $BUS_MODULES ; do
+               /sbin/modprobe -r $module >/dev/null 2>&1
+       done
+       ok
+       rm -f /var/lock/subsys/lm_sensors
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  status)
+       sensors
+       ;;
+  restart|reload)
+       stop
+       start
+       ;;
+  condrestart)
+       if [ -f /var/lock/subsys/lm_sensors ]; then
+               stop
+               start
+       fi
+       ;;
+  *)
+       msg_usage "$0 {start|stop|status|restart|reload|condrestart}"
+       exit 3
+esac
+
+exit $RETVAL
diff --git a/lm_sensors.sysconfig b/lm_sensors.sysconfig
new file mode 100644 (file)
index 0000000..5c787c5
--- /dev/null
@@ -0,0 +1,2 @@
+#    /etc/sysconfig/lm_sensors - Defines modules loaded by /etc/rc.d/init.d/lm_sensors
+# Run sensors-detect to generate this config file
diff --git a/sensors_modules.init b/sensors_modules.init
deleted file mode 100644 (file)
index 07c12e0..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# sensors_modules:     Hardware sensors monitoring
-#
-# Version:     $Revision$
-#
-# chkconfig:   2345 31 69
-# description: Loads and removes hardware sensors modules
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-# Get service config
-if [ -f /etc/sysconfig/sensors_modules ]; then
-       . /etc/sysconfig/sensors_modules
-fi
-
-start() {
-       # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/sensors_modules ]; then
-               if [ -z "$BUS" ] && [ -z "$CHIP" ]; then
-                       msg_starting "sensors modules"; fail
-                       nls "BUS or CHIP not configured in /etc/sysconfig/sensors_modules" >&2
-                       exit 6
-               fi
-
-               # insert modules
-               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
-               fi
-               touch /var/lock/subsys/sensors_modules
-       else
-               msg_already_running "sensors modules"
-       fi
-}
-
-stop() {
-       if [ -f /var/lock/subsys/sensors_modules ]; then
-               msg_stopping "sensors modules"
-
-               # remove kernel modules
-               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
-               ok
-               rm -f /var/lock/subsys/sensors_modules
-       else
-               msg_not_running "sensors modules"
-       fi
-}
-
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
-       start
-       ;;
-  stop)
-       stop
-       ;;
-  status)
-       sensors
-       ;;
-  restart|force-reload)
-       stop
-       start
-       ;;
-  *)
-       msg_usage "$0 {start|stop|restart|force-reload|status}"
-       exit 3
-esac
-
-exit $RETVAL
diff --git a/sensors_modules.sysconfig b/sensors_modules.sysconfig
deleted file mode 100644 (file)
index f94266e..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# configuration for harware sensors monitoring
-
-# configure sensors (i.e. call `sensors -s')
-# Allows to change min and max alarm limits from sensors.conf
-#SENSORS_SET=1
-
-# BUS - stands for i2c bus, empty or some of: acorn, ali1535, ali1563, ali15x3,
-#      amd756, amd756-s4882, amd8111, at91, au1550, bfin-twi, davinci, elektor,
-#      gpio, hydra, i801, i810, ibm_iic, iop3xx, isa, ixp2000, ixp4xx, mpc,
-#      mv64xxx, nforce2, ocores, omap, parport, parport-light, pasemi, pca-isa,
-#      piix4, pmcmsp, pnx, powermac, prosavage, pxa, s3c2410, savage4, sibyte,
-#      simtec, sis5595, sis630, sis96x, stub, taos-evm, tiny-usb, versatile,
-#      via, viapro, voodoo3
-# note: i2c-isa is obsolete since Linux >= 2.6.23, use empty BUS instead
-
-BUS=
-
-# CHIP - stands for sensors chip, one or more of: asb100, w83627hf, w83792d,
-#      w83793, w83781d, w83791d, abituguru, abituguru3, ad7418, adm1021,
-#      adm1025, adm1026, adm1029, adm1031, adm9240, adt7470, applesmc, atxp1,
-#      coretemp, dme1737, ds1621, f71805f, f71882fg, f75375s, fscher, fschmd,
-#      fscpos, gl518sm, gl520sm, hdaps, i5k_amb, ibmpex, it87, k8temp, lm63,
-#      lm70, lm75, lm77, lm78, lm80, lm83, lm85, lm87, lm90, lm92, lm93,
-#      max1619, max6650, pc87360, pc87427, sis5595, smsc47b397, smsc47m1,
-#      smsc47m192, thmc50, via686a, vt1211, vt8231, w83627ehf, w83l785ts,
-
-CHIP=
-
-# You may use sensors-detect commant to check what busses and chips are available
-
-# example for VIA KT* mainboards (sensors bus is ISA, not via)
-#      on Linux >= 2.6.23:
-# BUS=
-# CHIP=via686a
-#      on Linux < 2.6.23:
-# BUS=isa
-# CHIP=via686a
This page took 0.108615 seconds and 4 git commands to generate.