Re: udev problem with udevsettle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bryan Kadzban wrote:
You shouldn't call cryptsetup from the udev RUN key.  From the udev(7)
manpage:

RUN
  <...> This can only be used for very short running tasks. Running an
  event process for a long period of time may block all further events
  for this or a dependent device. Long running tasks need to be
  immediately detached from the event process itself.

When your RUN rule is executed, udev is in the middle of processing the
uevent for the USB storage device.  So while your script is running,
udev has not settled (the test that udevsettle uses to decide this will
never succeed, because the RUN rule that called udevsettle is not
finished).  To get the rule to finish processing, the program that RUN
ran needs to exit.  *Then* udevsettle will finish.

yes i see it, but anyway what does the "very short running tasks" means? my scripts is about a second (under normal circumstances) which is imho very short from a shell script:-)

It probably makes the most sense to just make your script run most of
its logic in the background, instead of the foreground.  I'm not sure
exactly what logic udevd uses, but I think it will work to write a
wrapper script that just runs your current script in the background:

yes i already solve it, but imho it's not a good habit to call udevsettle from cryptsetup.

--
  Levente                               "Si vis pacem para bellum!"
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux