On Fri, 17.04.15 14:19, Nir Soffer ([email protected]) wrote:

> - You may wait for unrelated events that happen to trigger in the same
>   time, waiting after the new interfaces are ready.
> 
> I think you need something like:
> 
>     while True:
>         try:
>             udevadm.settle(1)
>         except udevadm.Timeout:
>             pass
>         else:
>             if all devices are ready:
>                 break
>             time.sleep(1)

Please never use udevadm settle in new code.

Please instead subscribe to libudev events about network interfaces
and don't take rtnl messages into account until the device has been
reported via udev, too.

THis is for example what networkd does to make sure it doesn't start
making use of network interfaces that didn't get fully set up yet by
the udev rules.

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to