[dm-devel][PATCH] Uevent cookie env var support

Peter Rajnoha prajnoha at redhat.com
Wed Apr 8 12:58:46 UTC 2009


Kay Sievers wrote:
> If you would use the same cookie for several actions, how do you
> track, that udev has finished the work when you expect an arbitrary
> number of events with the same cookie?

Well, I use a simple semaphore in userspace waiting for zero. So for
every action I just increment the semaphore and when the cookie comes back
from uevent, I decrement it (I use this cookie value as the semaphore's
identifier as well). So the number of uevents I'm expecting is not
arbitrary from this perspective. I just need to fire off all the actions
and then at some point later need to be sure that all the udev rules
were executed (so I'm sure all the nodes are created) and so I can continue.

Peter




More information about the dm-devel mailing list