Subject: bug#47681: closed (Re: bug#47681: Reloading udev rules requires a system restart)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 21 Feb 2022 01:44:02 +0000

Your bug report

#47681: Reloading udev rules requires a system restart

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
47681: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47681
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#47681: Reloading udev rules requires a system restart
From: Maxim Cournoyer <[email-masked]>
To: [email-masked]
Date: Sun, 20 Feb 2022 20:43:40 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

Maxim Cournoyer <[email-masked]> 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

Subject: Reloading udev rules requires a system restart
From: Maxim Cournoyer <[email-masked]>
To: bug-guix <[email-masked]>
Date: Fri, 09 Apr 2021 18:05:37 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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