From df1aec8981acf9423495c110916292e3eed3a494 Mon Sep 17 00:00:00 2001 From: Jesse Smith Date: Sat, 25 May 2019 15:41:57 -0300 Subject: [PATCH] Accepted patch from Luc Gommans which explains why zombie and deep sleep processes (Z and D) may be hidden from pidof --- doc/Changelog | 2 ++ man/pidof.8 | 3 +++ src/killall5.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index 9c01957..722bbf2 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -17,6 +17,8 @@ sysvinit (2.95) unreleased; urgency=low with do_msleep(), provided by Serge Belyshev. * Replaced hardwired sleep constants in init.c with defined constants for easy updating in the future. + * Accepted patch from Luc Gommans which explains why zombie and + deep sleep processes (Z and D) may be hidden from pidof. sysvinit (2.94) released; urgency=low diff --git a/man/pidof.8 b/man/pidof.8 index 01723c1..4242d30 100644 --- a/man/pidof.8 +++ b/man/pidof.8 @@ -89,6 +89,9 @@ as the program you're after but are actually other programs. Note that the executable name of running processes is calculated with .BR readlink (2), so symbolic links to executables will also match. +.PP +Zombie processes or processes in disk sleep (states Z and D, respectively) +are ignored, as attempts to access the stats of these will sometimes fail. .SH SEE ALSO .BR shutdown (8), diff --git a/src/killall5.c b/src/killall5.c index 7b16920..46520e2 100644 --- a/src/killall5.c +++ b/src/killall5.c @@ -954,7 +954,7 @@ void pidof_usage(void) printf(" -o Omit results with a given PID\n"); printf(" -q Quiet mode. Do not display output\n"); printf(" -s Only return one PID\n"); - printf(" -x Return PIDs of shells running scritps with a matchign name\n"); + printf(" -x Return PIDs of shells running scripts with a matching name\n"); printf("\n"); }