Subject: Re: [devuan-dev] bug#392: When pid1==runit, mis-detects container and doesn't start

From: Svante Signell <[email-masked]>
Date: Mon, 10 Feb 2020 10:17:41 +0100

On Sun, 2020-02-09 at 11:34 +0100, KORN Andras wrote:
> Package: eudev
> Version: 3.2.9-4
> Severity: important
> 
> Hi,
> 
> the /etc/init.d/eudev initscript has this bit:
> 
> if ! ps -p1|grep -q "init\|systemd"; then
>   log_warning_msg "udevd does not support containers, not started"
>   exit 0
> fi

Thank you for your report.

So the name of pid 1 for runit-init is runit?
Then the test could be
-q "init\|runit\|systemd"

What about other init systems, like openrc-init? Perhaps the test should be
reversed if ps -p1 | -q "container tests here" instead.

The Debian package has a worse bug, the test is
if [ ! -w /sys ]; then which is always true, making it impossible to start udev
manually.

> If running with runit as the init system (which is obviously neither
> sysvinit nor systemd), the script exits without starting eudev, which
> results in no keyboard and mouse under X and no local way of switching to a
> text console.
> 
> Perhaps use virt-what to detect containers instead?

I've been looking for methods to detect containers, but have not found virt-
what. Do you have a link or a description?