[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/7] initscripts: use pidof -s /sbin/init for robustness
From: |
Justus Winter |
Subject: |
[PATCH 3/7] initscripts: use pidof -s /sbin/init for robustness |
Date: |
Thu, 15 Aug 2013 09:45:30 +0200 |
pidof -s returns the first matching process. Since readdir(2) on
procfs returns the processes in ascending order, this returns the
first process. This is more robust if there is more than one
/sbin/init process.
Currently on Hurd there are two /sbin/init processes. Clearly this
needs some investigation. But as far as I can tell this could also
happen if INITDEBUG is defined as /sbin/init then forks a child that
can be ptrace(2)d on a vanilla Linux kernel.
---
debian/changelog | 1 +
debian/src/initscripts/etc/init.d/mountall.sh | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 1ff8750..7d9aa05 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -53,6 +53,7 @@ sysvinit (2.88dsf-42) UNRELEASED; urgency=low
[ Justus Winter ]
* mount-functions.sh: Hurd has a tmpfs translator now, remove workaround.
* mount-functions.sh: Add -ocompatible to procfs mounts on Hurd.
+ * mountall.sh: Use pidof -s /sbin/init for robustness.
-- Roger Leigh <rleigh@debian.org> Sat, 04 May 2013 13:13:51 +0100
diff --git a/debian/src/initscripts/etc/init.d/mountall.sh
b/debian/src/initscripts/etc/init.d/mountall.sh
index 5f913cd..392eeec 100755
--- a/debian/src/initscripts/etc/init.d/mountall.sh
+++ b/debian/src/initscripts/etc/init.d/mountall.sh
@@ -55,7 +55,7 @@ do_start() {
mknod -m 600 "$INITCTL" p
# Reopen control channel.
- PID="$(pidof /sbin/init || echo 1)"
+ PID="$(pidof -s /sbin/init || echo 1)"
[ -n "$PID" ] && kill -s USR1 "$PID"
fi
--
1.7.10.4
- patches for sysvinit (2), Justus Winter, 2013/08/15
- [PATCH 1/7] initscripts: hurd has a proper tmpfs now, remove workaround, Justus Winter, 2013/08/15
- [PATCH 2/7] initscripts: add -ocompatible to procfs mounts on Hurd, Justus Winter, 2013/08/15
- [PATCH 3/7] initscripts: use pidof -s /sbin/init for robustness,
Justus Winter <=
- [PATCH 6/7] killall5.c: Use sysconf(_SC_SYMLOOP_MAX) instead of MAXSYMLINKS., Justus Winter, 2013/08/15
- [PATCH 4/7] initscripts: add runsystem.sysv, Justus Winter, 2013/08/15
- [PATCH 5/7] initscripts: Only run rootcheck on Linux, Justus Winter, 2013/08/15
- [PATCH 7/7] sysvinit: Fix getty path in /etc/inittab on Hurd., Justus Winter, 2013/08/15
- Re: patches for sysvinit (2), Samuel Thibault, 2013/08/28