Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403217 - sys-fs/udev: please add command "reload" to init script
Summary: sys-fs/udev: please add command "reload" to init script
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-11 22:17 UTC by Sebastian Pipping
Modified: 2012-08-01 17:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.