Bug#888743: pidofproc returns PIDs in foreign chroots and containers
Harald Dunkel <[email protected]> Fri, 8 Jun 2018 12:05:17 +0200
| Newsgroups | gmane.linux.debian.devel.lsb |
|---|---|
| Message-ID | <b9c6e4c0-0f35-2383-2128-48e8f708c387__14371.9911612154$1528452438$gmane$org@aixigo.de> |
This is a multi-part message in MIME format. --------------B1C947688B6228BD9F7DDCCD Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit AFAICS these bug reports seem to be related: #742588: stop action of init script on the host system kills nscd daemons in linux containers #858837: lsb-base: pidofproc should limit itself to processes in host system if running on an LXC host #888569: sysv startup script stumbles over smtpd running in a LXC container Probably there are more. Since I replaced "pidof" by "pidof -c" in a private lsb-base package Debian's startup procedure became much more stable in my environment (appr >200 hosts running Jessie and Stretch, systemd and sysvinit). I would suggest to include this change into experimental. Patch is attached. Another option might be to ignore pidof completely and rely upon the services' pidfiles. Regards Harri --------------B1C947688B6228BD9F7DDCCD Content-Type: text/x-patch; name="init-functions.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="init-functions.diff" diff -ur lsb-9.20161125/debian/changelog lsb-9.20161125+nmu1/debian/changelog --- lsb-9.20161125/debian/changelog 2016-11-25 16:15:24.000000000 +0100 +++ lsb-9.20161125+nmu1/debian/changelog 2018-01-29 14:32:26.000000000 +0100 @@ -1,3 +1,10 @@ +lsb (9.20161125+nmu1) unstable; urgency=medium + + * Non-maintainer upload. + * pidofproc: use "pidof -c" (Closes: #888743) + + -- Harald Dunkel <[email protected]> Mon, 29 Jan 2018 14:32:26 +0100 + lsb (9.20161125) unstable; urgency=medium [ Didier Raboud ] diff -ur lsb-9.20161125/init-functions lsb-9.20161125+nmu1/init-functions --- lsb-9.20161125/init-functions 2016-11-25 16:00:10.000000000 +0100 +++ lsb-9.20161125+nmu1/init-functions 2018-01-29 14:32:26.000000000 +0100 @@ -107,7 +107,7 @@ # pid file doesn't exist, try to find the pid nevertheless if [ -x /bin/pidof ] && [ ! "$specified" ]; then status="0" - /bin/pidof -o %PPID -x $1 || status="$?" + /bin/pidof -c -o %PPID -x $1 || status="$?" if [ "$status" = 1 ]; then return 3 # program is not running fi --------------B1C947688B6228BD9F7DDCCD--