Bug#926896: sysvinit-utils: pidof is unreliable

Jesse Smith jsmith at resonatingmedia.com
Thu Oct 21 18:51:36 BST 2021

> The RedHat bug that was the similar issue to #719273 (i.e. that
> resulted in the behaviour of pidof being changed) took a slightly
> different approach -
> https://bugzilla.redhat.com/show_bug.cgi?id=138788 (patch is
> https://bugzilla.redhat.com/attachment.cgi?id=113650&action=diff );
> did that ever make its way to upstream?

The Red Hat patch was a bit older, but I believe I've got it adjusted
and merged in okay. I've done some tests here and it looks like
everything is working with the newly patched pidof.

Here is what should happen now:

"pidof <process name>" should, without flags, display any processes
matches it finds, _except_ zombie processes. Basically anything running,
sleeping, or in uninterruptable sleep should now show up.

"pidof -z <process name>" should return all matching processes,
including those in the zombie state.

The attached patch also cleans up some code we don't need as a result of
this change and updates the man page.

Please give the attached patch a try and confirm it's working.  It's
working here for normal and zombie processes and it seems to be okay for
uninterruptable sleep processes too, but I'd like to have someone else
confirm everything looks right before I push this upstream.

- Jesse

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pidof-d-z-flag.patch
Type: text/x-patch
Size: 6047 bytes
Desc: not available
URL: <http://www.chiark.greenend.org.uk/pipermail/debian-init-diversity/attachments/20211021/6a061a21/attachment.bin>

More information about the Debian-init-diversity mailing list