Package: lm-sensors
Version: 1:3.1.0-2
Severity: wishlist
Tags: patch

Here is a patch to support the "status" action in the init scripts.  The exact 
behavior of the status action in lm-sensors.lm-sensors.init may be debatable, 
but I think it is good that any script gives some useful output and a correct 
exit code.

Note that the run-time dependencies on lsb-base are missing in the current 
versions.
diff -u lm-sensors-3-3.1.0/debian/control lm-sensors-3-3.1.0/debian/control
--- lm-sensors-3-3.1.0/debian/control
+++ lm-sensors-3-3.1.0/debian/control
@@ -9,7 +9,7 @@
 Package: lm-sensors
 Architecture: any
 Section: utils
-Depends: sed (>= 4.0.5-1), ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}
+Depends: sed (>= 4.0.5-1), lsb-base (>= 3.2-13), ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}
 Suggests: sensord, read-edid, i2c-tools
 Description: utilities to read temperature/voltage/fan sensors
  Lm-sensors is a hardware health monitoring package for Linux. It allows you
@@ -48,7 +48,7 @@
 Package: sensord
 Architecture: any
 Section: utils
-Depends: lm-sensors, ${shlibs:Depends}, ${misc:Depends}
+Depends: lm-sensors, lsb-base (>= 3.2-13), ${shlibs:Depends}, ${misc:Depends}
 Description: hardware sensor information logging daemon
  Lm-sensors is a hardware health monitoring package for Linux. It allows you
  to access information from temperature, voltage, and fan speed sensors. It
diff -u lm-sensors-3-3.1.0/debian/lm-sensors.lm-sensors.init lm-sensors-3-3.1.0/debian/lm-sensors.lm-sensors.init
--- lm-sensors-3-3.1.0/debian/lm-sensors.lm-sensors.init
+++ lm-sensors-3-3.1.0/debian/lm-sensors.lm-sensors.init
@@ -35,8 +35,11 @@
   force-reload|restart)
 	$0 start
 	;;
+  status)
+	/usr/bin/sensors && exit 0 || exit 4
+	;;
   *)
-	log_success_msg "Usage: /etc/init.d/sensors {start|stop|restart|force-reload}"
+	log_success_msg "Usage: /etc/init.d/sensors {start|stop|restart|force-reload|status}"
 	exit 1
 esac
 
diff -u lm-sensors-3-3.1.0/debian/lm-sensors.fancontrol.init lm-sensors-3-3.1.0/debian/lm-sensors.fancontrol.init
--- lm-sensors-3-3.1.0/debian/lm-sensors.fancontrol.init
+++ lm-sensors-3-3.1.0/debian/lm-sensors.fancontrol.init
@@ -51,8 +51,11 @@
 		$0 restart
 	fi
 	;;
+  status)
+	status_of_proc $DAEMON $NAME && exit 0 || exit $?
+	;;
   *)
-	log_success_msg "Usage: /etc/init.d/fancontrol {start|stop|restart|force-reload}"
+	log_success_msg "Usage: /etc/init.d/fancontrol {start|stop|restart|force-reload|status}"
 	exit 1
 	;;
 esac
diff -u lm-sensors-3-3.1.0/debian/sensord.init lm-sensors-3-3.1.0/debian/sensord.init
--- lm-sensors-3-3.1.0/debian/sensord.init
+++ lm-sensors-3-3.1.0/debian/sensord.init
@@ -52,8 +52,11 @@
 		$0 restart
 	fi
 	;;
+  status)
+	status_of_proc $DAEMON $NAME && exit 0 || exit $?
+	;;
   *)
-	echo "Usage: /etc/init.d/sensord {start|stop|restart|force-reload}"
+	echo "Usage: /etc/init.d/sensord {start|stop|restart|force-reload|status}"
 	exit 1
 esac
 

Reply via email to