rpms/lm_sensors/devel lm_sensors-3.0.1-lsb-retcodes.patch, NONE, 1.1 lm_sensors-3.0.1-service-default-off.patch, NONE, 1.1 lm_sensors.spec, 1.61, 1.62 lm_sensors-2.10.4-service-default-off.patch, 1.3, NONE lm_sensors-3.0.0-lsb-retcode.patch, 1.1, NONE

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Tue Feb 26 14:10:07 UTC 2008


Author: jwrdegoede

Update of /cvs/extras/rpms/lm_sensors/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6460

Modified Files:
	lm_sensors.spec 
Added Files:
	lm_sensors-3.0.1-lsb-retcodes.patch 
	lm_sensors-3.0.1-service-default-off.patch 
Removed Files:
	lm_sensors-2.10.4-service-default-off.patch 
	lm_sensors-3.0.0-lsb-retcode.patch 
Log Message:
* Tue Feb 26 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 3.0.1-3
- Some improvements to the lsb-retcodes and service-default-off patches
  from a review by upstream


lm_sensors-3.0.1-lsb-retcodes.patch:

--- NEW FILE lm_sensors-3.0.1-lsb-retcodes.patch ---
--- lm_sensors-3.0.1/prog/init/lm_sensors.init	2008-02-26 14:37:51.000000000 +0100
+++ lm_sensors-3.0.1.new/prog/init/lm_sensors.init	2008-02-26 14:25:13.000000000 +0100
@@ -28,31 +28,6 @@
 # in order as normal shell variables with the special names:
 #    MODULE_1, MODULE_2, MODULE_3, etc.
 
-if grep -q sysfs /proc/mounts; then
-	WITHSYS=1
-else
-	WITHSYS=0
-fi
-
-if [ $WITHSYS == "0" ]; then
-	# If sensors isn't supported by the kernel, try loading the module...
-	[ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc >/dev/null 2>&1
-
-	# Don't bother if /proc/sensors still doesn't exist, kernel doesn't have
-	# support for sensors.
-	[ -e /proc/sys/dev/sensors ] || exit 0
-
-	# If sensors was not already running, unload the module...
-	[ -e /var/lock/subsys/lm_sensors ] || /sbin/modprobe -r i2c-proc >/dev/null 2>&1
-fi
-
-CONFIG=/etc/sysconfig/lm_sensors
-[ -r "$CONFIG" ] || exit 0
-grep '^MODULE_' $CONFIG >/dev/null 2>&1 || exit 0
-
-# Load config file
-. "$CONFIG"
-
 PSENSORS=/usr/local/bin/sensors
 
 if [ ! -x $PSENSORS ]; then
@@ -65,7 +40,47 @@
 RETVAL=0
 prog="lm_sensors"
 
+# This functions checks if sensor support is compiled into the kernel, if
+# sensors are configured, and loads the config file
+check_sensors() {
+	if grep -q sysfs /proc/mounts; then
+		WITHSYS=1
+	else
+		WITHSYS=0
+	fi
+
+	if [ $WITHSYS == "0" ]; then
+		# If sensors isn't supported by the kernel, try loading the module...
+		[ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc >/dev/null 2>&1
+
+		# Don't bother if /proc/sensors still doesn't exist, kernel doesn't have
+		# support for sensors.
+		if ! [ -e /proc/sys/dev/sensors ]; then
+			echo -n "Starting $prog: kernel does not have sensors support"
+			echo_failure
+			echo
+			exit 5
+		fi
+
+		# If sensors was not already running, unload the module...
+		[ -e /var/lock/subsys/lm_sensors ] || /sbin/modprobe -r i2c-proc >/dev/null 2>&1
+	fi
+
+	CONFIG=/etc/sysconfig/lm_sensors
+	if ! [ -r "$CONFIG" ] || ! grep '^MODULE_' $CONFIG >/dev/null 2>&1; then
+		echo -n "Starting $prog: not configured, run sensors-detect"
+		echo_warning
+		echo
+		exit 6
+	fi
+
+	# Load config file
+	. "$CONFIG"
+}
+
 start() {
+	check_sensors
+
 	echo -n "Starting $prog: loading module "
 
 	modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '`
@@ -89,6 +104,8 @@
 }
 
 stop() {
+	check_sensors
+
 	echo -n "Stopping $prog: "
 
 	modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '`
@@ -116,12 +133,14 @@
 dostatus() {
 	$PSENSORS
 	RETVAL=$?
+	if [ $RETVAL -ne 0 ]; then
+		RETVAL=3
+	fi
 }
 
 restart() {
 	stop
 	start
-	RETVAL=$?
 }
 
 condrestart() {
@@ -147,7 +166,7 @@
 	;;
   *)
 	echo "Usage: $0 {start|stop|status|restart|reload|condrestart}"
-	exit 1
+	exit 3
 esac
 
 exit $RETVAL

lm_sensors-3.0.1-service-default-off.patch:

--- NEW FILE lm_sensors-3.0.1-service-default-off.patch ---
--- lm_sensors-3.0.1/prog/init/lm_sensors.init.default-off	2007-04-27 14:34:17.000000000 +0200
+++ lm_sensors-3.0.1/prog/init/lm_sensors.init	2008-02-26 14:55:58.000000000 +0100
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# chkconfig: 2345 26 74
+# chkconfig: - 26 74
 # description: sensors is used for monitoring motherboard sensor values.
 # config: /etc/sysconfig/lm_sensors
 #
--- lm_sensors-3.0.1/prog/detect/sensors-detect.default-off	2008-01-22 13:22:47.000000000 +0100
+++ lm_sensors-3.0.1/prog/detect/sensors-detect	2008-02-26 15:00:07.000000000 +0100
@@ -5673,6 +5673,11 @@ sub main
     exit -1;
   }
 
+  if (-x "/sbin/service" && -f "/etc/init.d/lm_sensors" &&
+      -f "/var/lock/subsys/lm_sensors") {
+    system("/sbin/service", "lm_sensors", "stop");
+  }
+
   initialize_kernel_version();
   initialize_conf;
   initialize_proc_pci;
@@ -5943,6 +5948,11 @@ EOT
 
     if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") {
       system("/sbin/insserv", "/etc/init.d/lm_sensors");
+    } elsif (-x "/sbin/chkconfig" && -f "/etc/init.d/lm_sensors") {
+      system("/sbin/chkconfig", "lm_sensors", "on");
+      if (-x "/sbin/service") {
+        system("/sbin/service", "lm_sensors", "start");
+      }
     } else {
       print "You should now start the lm_sensors service to load the required\n".
             "kernel modules.\n\n";


Index: lm_sensors.spec
===================================================================
RCS file: /cvs/extras/rpms/lm_sensors/devel/lm_sensors.spec,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- lm_sensors.spec	19 Feb 2008 19:47:05 -0000	1.61
+++ lm_sensors.spec	26 Feb 2008 14:09:27 -0000	1.62
@@ -1,14 +1,14 @@
 Name: lm_sensors
 Version: 3.0.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 URL: http://www.lm-sensors.org/
 Source: http://dl.lm-sensors.org/lm-sensors/releases/%{name}-%{version}.tar.bz2
 Source1: lm_sensors.sysconfig
 # these 2 were taken from PLD-linux, Thanks!
 Source2: sensord.sysconfig
 Source3: sensord.init
-Patch0: lm_sensors-2.10.4-service-default-off.patch
-Patch1: lm_sensors-3.0.0-lsb-retcode.patch
+Patch0: lm_sensors-3.0.1-service-default-off.patch
+Patch1: lm_sensors-3.0.1-lsb-retcodes.patch
 Patch2: lm_sensors-3.0.1-sensors-detect-special-chips.patch
 Summary: Hardware monitoring tools
 Group: Applications/System
@@ -167,6 +167,10 @@
 
 
 %changelog
+* Tue Feb 26 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 3.0.1-3
+- Some improvements to the lsb-retcodes and service-default-off patches
+  from a review by upstream
+
 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 3.0.1-2
 - Autorebuild for GCC 4.3
 


--- lm_sensors-2.10.4-service-default-off.patch DELETED ---


--- lm_sensors-3.0.0-lsb-retcode.patch DELETED ---




More information about the fedora-extras-commits mailing list