diff options
author | Harald Dunkel <harald.dunkel@aixigo.de> | 2019-03-24 14:24:13 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2019-03-24 14:24:30 +0100 |
commit | 88e04b794024c4350e9925ec5a2f879244fe70c0 (patch) | |
tree | 761868d5741a1baf7fb6b2f56d93ffb95934e2bf | |
parent | 674781a3b4e40b47f63ad2f370cbb140c2e04c25 (diff) |
pidofproc: use "pidof -c" to avoid pidofproc results from containers or chroots
From pidof's manpage:
-c Only return process PIDs that are running with the same root
directory. This option is ignored for non-root users, as they will
be unable to check the current root directory of processes they do
not own.
Closes: #888743
-rw-r--r-- | init-functions | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/init-functions b/init-functions index 252da64..207b270 100644 --- a/init-functions +++ b/init-functions @@ -107,7 +107,7 @@ pidofproc () { # 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 |