[packages/rc-scripts: 1/2] support multiple pids in pidfile with start-stop-daemon

glen glen at pld-linux.org
Mon Dec 31 12:11:00 CET 2018


commit 818437cc498a9b86b47a08a458ed955cf80a1369
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Fri Sep 7 17:10:51 2018 +0300

    support multiple pids in pidfile with start-stop-daemon

 95229.patch     | 28 ++++++++++++++++++++++++++++
 rc-scripts.spec |  2 ++
 2 files changed, 30 insertions(+)
---
diff --git a/rc-scripts.spec b/rc-scripts.spec
index 405c0e0..1389146 100644
--- a/rc-scripts.spec
+++ b/rc-scripts.spec
@@ -20,6 +20,7 @@ Source0:	%{name}-%{version}.tar.gz
 Source1:	rc-local.service
 Source2:	sys-chroots.service
 Source3:	%{name}.tmpfiles
+Patch0:	95229.patch
 URL:		http://svn.pld-linux.org/trac/svn/wiki/packages/rc-scripts
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -137,6 +138,7 @@ po cichu ignorowane.
 
 %prep
 %setup -q
+%patch0 -p3 -d lib
 
 # hack, currently this results in errno@@GLIBC_PRIVATE symbol in ppp-watch:
 #GLIB_LIBS="-Wl,-static `$PKG_CONFIG --libs --static glib-2.0` -Wl,-Bdynamic"
diff --git a/95229.patch b/95229.patch
new file mode 100644
index 0000000..4945bca
--- /dev/null
+++ b/95229.patch
@@ -0,0 +1,28 @@
+--- /etc/init.d/functions~	2018-09-07 16:57:25.000000000 +0300
++++ /etc/init.d/functions	2018-09-07 17:02:41.443552246 +0300
+@@ -884,12 +883,19 @@
+ 			# 3. kill with KILL, wait $waitretry
+ 			retry="--retry ${sig#-}/${delay}/${sig#-}/${waittime}/KILL/${waitretry}"
+ 		fi
+-		/sbin/start-stop-daemon -q --stop \
+-			$retry \
+-			${waitname:+--name $waitname} \
+-			-s ${sig#-} \
+-			${pidfile:+--pidfile $pidfile}
+-		result=$?
++
++		# expand if pidfile has multiple pids
++		result=0
++		local pid
++
++		for pid in $(cat $pidfile); do
++			/sbin/start-stop-daemon -q --stop \
++				$retry \
++				${waitname:+--name $waitname} \
++				-s ${sig#-} \
++				--pid $pid || result=$?
++		done
++
+ 		if [ "$result" -eq 0 ]; then
+ 			ok
+ 		else
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list