[systemd-devel] How to wait for a group of devices?
Kay Sievers
kay at vrfy.org
Mon Aug 19 08:49:39 PDT 2013
On Mon, Aug 19, 2013 at 5:35 PM, Manuel Reimer
<Manuel.Spam at nurfuerspam.de> wrote:
> On 08/19/2013 04:53 PM, Greg KH wrote:
>>>
>>> The second one wants to access DVB devices.
>>>
>>> These could be connected via PCI, PCI express or USB. So here I need
>>> "Wait until all possible, currently connected, DVB devices are
>>> initialized and drivers are loaded".
>>
>>
>> Same here, there is no way to ever do this (PCI devices can be
>> hotplugged at anytime, just like USB).
>>
>> Instead, just do something based on _when_ you see a specific type of
>> USB device, that way everything will work properly, no need to "wait"
>> for anything.
>
>
> I'm not the developer of that daemon. I just want to run it reliably on a
> distribution, using systemd.
>
> Isn't there some kind of event, I can wait for, when the system did the
> first run over the connected devices?
As Greg already said, there is no point in time where we could send
out such an event. If you want, read it as: systemd boots up and
enumerates devices until you shut down the system.
Such a daemon needs to monitor new devices, build its own list/tree of
it, and starts using them when it decides they are ready to be used.
For legacy applications, which are too simple to do that, "udevadm
settle" is the only tool that can provide something like that.
There is nothing in the base OS could claim to be able to send an
event for the state of "everything is there" or "there are no more
devices to expect", it's just not how things work or should work.
Kay
More information about the systemd-devel
mailing list