Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#79762 - [systemd] udevd_live() in systemd-hook script erroneously thinks udevd is running
Attached to Project:
Arch Linux
Opened by Hugo Trassoudaine (hugotrsd) - Saturday, 23 September 2023, 10:08 GMT
Last edited by Christian Hesse (eworm) - Tuesday, 26 September 2023, 20:48 GMT
Opened by Hugo Trassoudaine (hugotrsd) - Saturday, 23 September 2023, 10:08 GMT
Last edited by Christian Hesse (eworm) - Tuesday, 26 September 2023, 20:48 GMT
|
DetailsDescription:
Check performed at https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/blob/c8277d5d9ddf0d30bb84b97df5e9702637be7880/systemd-hook#L20 is not sufficient to determine if udev is running or not. This causes "/usr/share/libalpm/scripts/systemd-hook udev-reload" to report an error: "Failed to send reload request: No such file or directory" This causes pacman to report an error when running hook 30-systemd-udev-reload.hook. Instead of looking for the directory, changing the condition to check for the socket fixes the issue. ie. changing [ ! -d /run/udev ] to [ ! -S /run/udev/control ] This is relevant since other parts of the system may dynamically create files under /run/udev, even if the daemon is not running. Notably, distrobuilder updated their systemd-generator script to do just that about a year ago. While this may be considered a bug on distrobuilder side, I feel like it makes more sense to fix it here. See: https://github.com/lxc/distrobuilder/blob/29e94ac90dc52ae4e5fc0c6ad34951d4369aa001/distrobuilder/main.go#L825-L837 Additional info: * running systemd 254.4-1 * noticed in LXD/Incus containers (with "lxc.mount.auto = sys:ro" option to prevent systemd-udevd.service from running) Steps to reproduce: * Ensure systemd-udevd.service is not running * Ensure /run/udev exists * Run "/usr/share/libalpm/scripts/systemd-hook udev-reload" or "pacman -S systemd" |
This task depends upon
Closed by Christian Hesse (eworm)
Tuesday, 26 September 2023, 20:48 GMT
Reason for closing: Fixed
Additional comments about closing: in git
Tuesday, 26 September 2023, 20:48 GMT
Reason for closing: Fixed
Additional comments about closing: in git
> * Ensure /run/udev exists
At first glance, those conditions would seem to be quite rare. But your suggested improvement is probably more accurate.
I'm running unprivileged LXD with the default ArchLinux image (made with distrobuilder).
- 1. By default, /sys is mounted read-write, but isn't actually writable (owned by nobody:nobody). This goes against https://systemd.io/CONTAINER_INTERFACE/.
- 2. SystemD's "ConditionPathIsReadWrite=/sys" does not detect this correctly, causing systemd-udevd.service to start.
- 3. Adding "lxc.mount.auto = sys:ro" to LXD's configuration fixes 1 and 2. However, the default ArchLinux image has a /etc/systemd/system-generator/lxc script which creates files under /run/udev if /etc/udev exists.
- 4. /etc/udev is owned and part of systemd, removing it and rebooting works, but it's not really a fix (it will come back on package upgrades).
I feel like both /usr/share/libalpm/scripts/systemd-hook and /etc/systemd/system-generator/lxc are wrong in how they check for udev.
Fixing one of them solves the issue, and to me the lowest hanging fruit is /usr/share/libalpm/scripts/systemd-hook.