It would be great if the init script of udev would provide a command "reload" to make udev reload its database of rules files similar to what the init script of apache offers. According to [1] this could be done using # udevadm control --reload-rules internally. Thanks! [1] http://www.abarry.org/likelytobeforgotten/?p=21
There's a catch or two about it: - let's start with http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=7c85d636e646a5c2021d1daaab10282f340e0134 - also, in the docs : "...Reloading rules and databases does not apply any changes to already existing devices; the new configuration will only be applied to new events...."
The only valid usecase for this would be udev or kernel without inotify. But that is not supported in newer udev versions. So reloading is always done automatically. But we could add a parameter "trigger" to run udevadm trigger.
(In reply to comment #0) > It would be great if the init script of udev would provide a command "reload" > to make udev reload its database of rules files similar to what the init script > of apache offers. > > According to [1] this could be done using > > # udevadm control --reload-rules Actually this is not correct. The internal command is # udevadm control --reload (In reply to comment #2) > The only valid usecase for this would be udev or kernel without inotify. > But that is not supported in newer udev versions. > So reloading is always done automatically. I'll ask upstream about valid use cases for this. > But we could add a parameter "trigger" to run udevadm trigger. I'm not sure this is a good idea. We would have to decide which type of events to trigger and which action to run.
I got the following information from the udev author: Udev no longer uses inotify. Instead, it checks the timestamps of the rules directories before every event it processes, but no more often than once every 3 seconds. If the timestamps have changed, the files are reloaded. Given that information, I don't know of a use case for the reload option. Also, I don't see a need to add a trigger option because it is just as easy for the sysadmin to run "udevadm trigger" and give it the options they need to directly. Any thoughts? William
(In reply to comment #3) > > According to [1] this could be done using > > > > # udevadm control --reload-rules > > Actually this is not correct. The internal command is > > # udevadm control --reload FYI for 171-r5 it is --reload-rules, I have checked (including source code). Best, Sebastian
@comment 3 and comment 5: Well, as I wrote in comment 1 that's both right and wrong, depending on the version.
This is added in udev-init-scripts-14/udev-187.