[packages/rc-scripts/AC-branch: 1/2] backport svn-id: @12603 -- killproc: improve experimental start-stop-daemon based killing.

glen glen at pld-linux.org
Sat Mar 29 21:24:20 CET 2014


commit fad128ab278b6708f617660b34946f4cd767d2f5
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Mar 29 20:32:27 2014 +0200

    backport svn-id: @12603 -- killproc: improve experimental start-stop-daemon based killing.
    
    without this patch enabling FASTRC or disabling RC_LOGGING has fatal
    effect: logrotate terminates lighttpd process with SIGKILL after 60
    seconds of sending first SIGHUP

 ...prove-experimental-start-stop-daemon-base.patch | 42 ++++++++++++++++++++++
 rc-scripts.spec                                    |  4 ++-
 2 files changed, 45 insertions(+), 1 deletion(-)
---
diff --git a/rc-scripts.spec b/rc-scripts.spec
index c6047ec..0d0f954 100644
--- a/rc-scripts.spec
+++ b/rc-scripts.spec
@@ -9,11 +9,12 @@ Summary(pl.UTF-8):	inittab i skrypty startowe z katalogu /etc/rc.d
 Summary(tr.UTF-8):	inittab ve /etc/rc.d dosyaları
 Name:		rc-scripts
 Version:	0.4.3.7
-Release:	1
+Release:	2
 License:	GPL v2
 Group:		Base
 Source0:	ftp://distfiles.pld-linux.org/src/%{name}-%{version}.tar.gz
 # Source0-md5:	6f349b3c5e74e538e14eaab389625643
+Patch0:		0001-killproc-improve-experimental-start-stop-daemon-base.patch
 URL:		http://svn.pld-linux.org/cgi-bin/viewsvn/rc-scripts/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -108,6 +109,7 @@ programcıklar içerir.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__aclocal}
diff --git a/0001-killproc-improve-experimental-start-stop-daemon-base.patch b/0001-killproc-improve-experimental-start-stop-daemon-base.patch
new file mode 100644
index 0000000..6b8995a
--- /dev/null
+++ b/0001-killproc-improve-experimental-start-stop-daemon-base.patch
@@ -0,0 +1,42 @@
+From 6154a5cecca4c7cf7252a230f81d2fa913c0bfab Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= <glen at pld-linux.org>
+Date: Wed, 5 Dec 2012 20:54:15 +0000
+Subject: [PATCH] killproc: improve experimental start-stop-daemon based
+ killing.
+
+do not send --retry, in case we specify a signal to kill (usually HUP)
+as processes do not usually exit (remove their pid from pidfile) if they receive HUP
+
+
+svn-id: @12603
+---
+ lib/functions | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/lib/functions b/lib/functions
+index 3b9fc39..e7debac 100644
+--- a/rc.d/init.d/functions
++++ b/rc.d/init.d/functions
+@@ -754,9 +754,17 @@ killproc() {
+ 	# experimental start-stop-daemon based killing.
+ 	# works only with pidfile
+ 	if is_no "$RC_LOGGING" && [ "$pidfile" ]; then
+-		local sig=${killlevel:--TERM}
++		local sig=${killlevel:--TERM} retry
++		# retry only if signal is not specified,
++	   	# as otherwise impossible to send HUP if process pid stays in pidfile.
++		if [ "${killlevel+set}" = "set" ]; then
++			# if we send HUP it's ok if process does not die
++			retry="--oknodo"
++		else
++			retry="--retry ${sig#-}/10/${sig#-}/60/KILL/10"
++		fi
+ 		/sbin/start-stop-daemon -q --stop \
+-			--retry ${sig#-}/10/${sig#-}/60/KILL/10 \
++			$retry \
+ 			-s ${sig#-} \
+ 			${pidfile:+--pidfile $pidfile}
+ 		result=$?
+-- 
+1.9.1
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rc-scripts.git/commitdiff/e508e73dc691e9b7fd1ad3e2490783f360d665c0



More information about the pld-cvs-commit mailing list