GNU bug report logs -
#47681
Reloading udev rules requires a system restart
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sun, 20 Feb 2022 20:43:40 -0500
with message-id <87v8x9ouyb.fsf_-_ <at> gmail.com>
and subject line Re: bug#47681: Reloading udev rules requires a system restart
has caused the debbugs.gnu.org bug report #47681,
regarding Reloading udev rules requires a system restart
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
47681: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47681
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Hello Guix!
Using Guix System, after adding a new rule to the configuration of their
udev-service-type service, the only ways to get the new rule into effect
are to either:
1. restart udev
(which is almost the same as a reboot, bringing down your graphical session)
2. restart the operating system
Both of which are sub-optimal.
This is caused by the configuration file/rules being made known to udev
via environment variables:
$ sudo cat /proc/$(pgrep udev)/environ | xargs -0 -n1 echo
UDEV_CONFIG_FILE=/gnu/store/7yfpf8acjy884xbwaq5kn9z21irchfaj-udev.conf
EUDEV_RULES_DIRECTORY=/gnu/store/yv58b7rg7dm3191cj6sma896550wgy4v-udev-rules/lib/udev/rules.d
LINUX_MODULE_DIRECTORY=/run/booted-system/kernel/lib/modules
PATH=/run/current-system/profile/bin
For convenience, we should probably have the udev-service-type create a
union of what it needs under /etc/udev/ as on other distributions. udev
could then rely on a fixed location to look things and use its inotify
based mechanism to detect changes and reload automatically when needed.
This could probably fix things such as 'udevadm test' only reading rule
files from under
/gnu/store/svplp9wl0g2ahlv5rf6bhmq3xvp4zzh3-eudev-3.2.9/lib/udev/rules.d,
for example.
Thank you,
Maxim
[Message part 3 (message/rfc822, inline)]
Hello,
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
> Fixes <https://issues.guix.gnu.org/47681>.
>
> This change adjusts the location of the udev configuration file and rules
> directory to a fixed location. Since udev relies on inotify to discover
> change to its rules directory (/etc/udev/rules.d), by using a fixed directory
> layout, new udev rules can be automatically picked up without restarting the
> service.
>
> * gnu/services/base.scm (udev-rules-union): Build rules output directly
> in #$output.
> (udev-shepherd-service)[start]: Adjust the UDEV_CONFIG_FILE and
> EUDEV_RULES_DIRECTORY environment variables.
> [actions]: Remove field. The 'rules' action is no longer useful.
> (udev.conf): New variable.
> (udev-etc): New procedure.
> (udev-service-type): Extend the etc-service-type with it.
Pushed with commit e9fa17eb98efbd6211ab44ab49b8c078d4b73e04.
Closing.
Maxim
This bug report was last modified 3 years and 146 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.