On Mon, Apr 20, 2015 at 08:43:21PM +0200, Lennart Poettering wrote:
> 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.

Could you explain why? Is it because we are not sure if "our" events
have not been queued when "settle" is called, or something more dramatic
that should be documented in udevadm(1)?

> 
> 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
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to