SOURCES: hdapsd.init - make sure that we have hdaps_protect kernel...

adamg adamg at pld-linux.org
Thu Apr 6 08:55:54 CEST 2006


Author: adamg                        Date: Thu Apr  6 06:55:54 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- make sure that we have hdaps_protect kernel enabled before starting
  hdaps daemon
- do not HUP hdapsd in reload/force-reload - it makes it die; use
  $0 restart instead

---- Files affected:
SOURCES:
   hdapsd.init (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/hdapsd.init
diff -u SOURCES/hdapsd.init:1.2 SOURCES/hdapsd.init:1.3
--- SOURCES/hdapsd.init:1.2	Sun Mar 26 14:36:58 2006
+++ SOURCES/hdapsd.init	Thu Apr  6 08:55:49 2006
@@ -21,6 +21,16 @@
 # See how we were called.
 case "$1" in
   start)
+  	# check whether kernel is hdaps_protect enabled
+	if [ ! -f /sys/devices/platform/hdaps/position ]; then
+		# it is not, try to load hdaps module and see if that helps
+		_modprobe hdaps
+		if [ ! -f /sys/devices/platform/hdaps/position ]; then
+			fail
+			exit 1
+		fi;
+	fi;
+	
 	# Start daemons.
 	if [ ! -f /var/lock/subsys/hdapsd ]; then
 		msg_starting hdapsd
@@ -43,9 +53,7 @@
 	;;
   reload|force-reload)
 	if [ -f /var/lock/subsys/hdapsd ]; then
-		msg_reloading hdapsd
-		killproc hdapsd -HUP
-		RETVAL=$?
+		$0 restart
 	else
 		msg_not_running hdapsd >&2
 		exit 7
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/hdapsd.init?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list