Bug#926896: sysvinit-utils: pidof is unreliable

Dmitry Bogatov KAction at disroot.org
Sun Oct 20 19:59:51 BST 2019

[2019-10-17 15:04] Martin von Wittich <martin.von.wittich at iserv.eu>
> I also just noticed this issue. We have a piece of code in our
> software that uses pidof to wait to apcupsd to start; I've reduced it
> to the following minimal working example:
> [...]

> There's always at least 4-6 empty "pidof:" lines at the beginning, so
> apparently pidof never works in the ~40-60ms after a process was
> launched.

That sounds explainable. pidof() scans /proc directory, and it takes some
time for kernel to create entry there.

> But there are almost always holes in the output further on, so it's
> also slightly unreliable afterwards.

This is really wierd, given that pid is same: process is not restarted.

> #!/bin/bash
> set -eu
> systemctl restart apcupsd

Do you have receipe to reproduce issue on systemd-free box, so I can try
to debug issue myself?
Note, that I send and fetch email in batch, once in a few days.
Please, mention in body of your reply when you add or remove recepients.

More information about the Debian-init-diversity mailing list