SVN: rc-scripts/trunk/rc.d/init.d/functions

glen glen at pld-linux.org
Tue Dec 16 19:55:36 CET 2008


Author: glen
Date: Tue Dec 16 19:55:36 2008
New Revision: 10037

Modified:
   rc-scripts/trunk/rc.d/init.d/functions
Log:
- try ssd for killproc. needs pidfile to work reliably
- what values to use for --retry?

Modified: rc-scripts/trunk/rc.d/init.d/functions
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/functions	(original)
+++ rc-scripts/trunk/rc.d/init.d/functions	Tue Dec 16 19:55:36 2008
@@ -668,9 +668,27 @@
 		killlevel=$2
 	else
 		notset=1
-		killlevel="-9"
+		killlevel="-KILL"
 	fi
 
+	# experimental start-stop-daemon based killing.
+	# works only with pidfile
+	if is_no "$RC_LOGGING" && [ "$pidfile" ]; then
+		local sig=${killevel:--TERM}
+		/sbin/start-stop-daemon --stop \
+			--retry ${sig#-}/10/${sig#-}/60/KILL/10 \
+			-s ${sig#-} \
+			${pidfile:+--pidfile $pidfile}
+		result=$?
+		if [ "$result" -eq 0 ]; then
+			ok
+		else
+			fail
+		fi
+		return $result
+	fi
+
+
 	# Save basename.
 	base=${1##*/}
 


More information about the pld-cvs-commit mailing list