Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 403217

Summary: sys-fs/udev: please add command "reload" to init script
Product: Gentoo Linux Reporter: Sebastian Pipping <sping>
Component: Current packagesAssignee: udev maintainers <udev-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Sebastian Pipping gentoo-dev 2012-02-11 22:17:27 UTC
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
Comment 1 Rafał Mużyło 2012-02-12 00:14:34 UTC
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...."
Comment 2 Matthias Schwarzott gentoo-dev 2012-02-14 09:30:15 UTC
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.
Comment 3 William Hubbs gentoo-dev 2012-02-14 15:10:51 UTC
(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.
Comment 4 William Hubbs gentoo-dev 2012-02-14 16:51:21 UTC
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
Comment 5 Sebastian Pipping gentoo-dev 2012-02-14 18:26:56 UTC
(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 6 Rafał Mużyło 2012-02-14 19:06:47 UTC
@comment 3 and comment 5:

Well, as I wrote in comment 1 that's both right and wrong, depending on the version.
Comment 7 William Hubbs gentoo-dev 2012-08-01 17:29:43 UTC
This is added in udev-init-scripts-14/udev-187.