Package: initscripts
Version: 2.88dsf-41
Severity: normal
Tags: patch

Dear Maintainer,

There is convention starting that processes whos name starts with '@'
shouldn't be killed. It is used to indicate that process is needed to
manage root device / cleanly unmount the root filesystem.

At least mdadm supports it for it's 'mdmon' process which is daemon
needed to manage containers (aka fakeraid controllers - Intel Matrix
Raid and DDF).

I've implemented a patch using pgrep, thus it's optional code in
sendsigs if pgrep is not available.

Regards,

Dimitri.

>From 79c394b5430104e208a8dffb2903d6bcc0ff2559 Mon Sep 17 00:00:00 2001
From: Dimitri John Ledkov <x...@ubuntu.com>
Date: Thu, 13 Feb 2014 13:53:36 +0000
Subject: [PATCH] In sendsigs, skip killing process who's name starts with '@'.

---
 debian/changelog                           |  4 ++++
 debian/src/initscripts/etc/init.d/sendsigs | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index ac3f0a0..501c6e6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,12 @@
 sysvinit (2.88dsf-52) UNRELEASED; urgency=low
 
+  [ Petter Reinholdtsen ]
   * Replace debian/watch with file available from
     http://qa.debian.org/cgi-bin/watchfile.cgi?package=sysvinit .
 
+  [ Dimitri John Ledkov ]
+  * In sendsigs, skip killing process who's name starts with '@'.
+
  -- Petter Reinholdtsen <p...@debian.org>  Thu, 13 Feb 2014 13:23:35 +0100
 
 sysvinit (2.88dsf-51) unstable; urgency=low
diff --git a/debian/src/initscripts/etc/init.d/sendsigs b/debian/src/initscripts/etc/init.d/sendsigs
index 04bd03c..2563314 100755
--- a/debian/src/initscripts/etc/init.d/sendsigs
+++ b/debian/src/initscripts/etc/init.d/sendsigs
@@ -58,6 +58,19 @@ do_stop () {
 		done
 	fi
 
+	# A convention is starting that process whos name starts with
+	# '@' shouldn't be killed by systeminit, as typically those
+	# processes are started to manage the root filesystem. Skip
+	# killing those as well.
+	#
+	# TODO: don't use pgrep...
+	#
+	if [ -x /usr/bin/pgrep ]; then
+	    for pid in $(pgrep -f '^@'); do
+		OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
+	    done
+	fi
+
 	# Flush the kernel I/O buffer before we start to kill
 	# processes, to make sure the IO of already stopped services to
 	# not slow down the remaining processes to a point where they
-- 
1.9.rc1

Reply via email to