[systemd-devel] upower fails with PrivateNetwork=true

Mantas Mikulėnas grawity at gmail.com
Thu Jul 5 11:01:48 UTC 2018


On Thu, Jul 5, 2018 at 1:13 PM Michael Biebl <mbiebl at gmail.com> wrote:

> Hi,
>
> in the latest upower release 0.99.8, the systemd service file was
> locked down considerably[1]. Unfortunately, a result of that is, that
> upower no longer detects any plug/unplug events [2].
> Through some trial and error I found that it's the addition of
> PrivateNetworks=true which broke upower.
> Now I'm a bit puzzled why upower would need network to function properly.
>

Plug/unplug events are device uevents sent via AF_NETLINK socket. If you
have PrivateNetworks=true, upower gets its own network namespace and is
isolated from anything that udev (re)sends in the main namespace.

(Looks like namespaces can still receive the original kernel-generated
uevents, but without the extra information that udev attaches to
retransmitted ones – that's probably not enough for libudev to work.
Compare `udevadm monitor -p` vs `unshare --net udevadm monitor -p`.)

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180705/aaa04820/attachment-0001.html>


More information about the systemd-devel mailing list