From 41521e3a21fd266f553fe4f10a3ba97be41d1e55 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 9 Aug 2023 07:13:09 +0900 Subject: [PATCH 1/3] Revert "unit: make udev rules take precesence over tmpfiles" This reverts commit 31845ef554877525dc4ff4f25ad11ad805ebf81c. systemd-tmpfiles-setup-dev.service has Before=systemd-udevd.service. So the commit does not change anything. --- units/systemd-udevd.service.in | 1 - 1 file changed, 1 deletion(-) diff --git a/units/systemd-udevd.service.in b/units/systemd-udevd.service.in index 7682baeec1..b59fdef9b0 100644 --- a/units/systemd-udevd.service.in +++ b/units/systemd-udevd.service.in @@ -12,7 +12,6 @@ Description=Rule-based Manager for Device Events and Files Documentation=man:systemd-udevd.service(8) man:udev(7) DefaultDependencies=no After=systemd-sysusers.service systemd-hwdb-update.service -After=systemd-tmpfiles-setup-dev.service Before=sysinit.target ConditionPathIsReadWrite=/sys From 112a41b6ece19d03e951d886fe2f26512ab31fab Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 9 Aug 2023 07:15:26 +0900 Subject: [PATCH 2/3] unit: make udev rules really take precedence over tmpfiles Follow-up for b42482af904ae0b94a6e4501ec595448f0ba1c06. The commit makes systemd-tmpfiles-setup.service also updates the permission or owner of device nodes. However, the service does not have ordering for systemd-udevd.service. So, the service may set different permission from the one udevd already set. Fixes #28653. Replaces #28681. --- units/systemd-tmpfiles-setup.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units/systemd-tmpfiles-setup.service b/units/systemd-tmpfiles-setup.service index 6c5e3de8fd..2e04733a5d 100644 --- a/units/systemd-tmpfiles-setup.service +++ b/units/systemd-tmpfiles-setup.service @@ -13,7 +13,7 @@ Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8) DefaultDependencies=no After=local-fs.target systemd-sysusers.service systemd-journald.service -Before=sysinit.target +Before=sysinit.target systemd-udevd.service Conflicts=shutdown.target initrd-switch-root.target Before=shutdown.target initrd-switch-root.target RefuseManualStop=yes From 3178698bb5352989e4bff866641838b1c2a0efcb Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 9 Aug 2023 07:20:49 +0900 Subject: [PATCH 3/3] test: also check the ordering between udevd and tmpfiles-setup --- test/units/testsuite-17.00.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/units/testsuite-17.00.sh b/test/units/testsuite-17.00.sh index 0203af88c4..a72c0fb792 100755 --- a/test/units/testsuite-17.00.sh +++ b/test/units/testsuite-17.00.sh @@ -11,6 +11,9 @@ set -o pipefail assert_in "systemd-tmpfiles-setup-dev.service" "$(systemctl show --property After --value systemd-udevd.service)" assert_in "systemd-udevd.service" "$(systemctl show --property Before --value systemd-tmpfiles-setup-dev.service)" +assert_in "systemd-tmpfiles-setup.service" "$(systemctl show --property After --value systemd-udevd.service)" +assert_in "systemd-udevd.service" "$(systemctl show --property Before --value systemd-tmpfiles-setup.service)" + if [[ -f /dev/vfio/vfio ]]; then assert_in "crw-rw-rw-" "$(stat --format=%A /dev/vfio/vfio)" fi