From 3240dc522000318de3809ed14dd11abbbd7449cf Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Tue, 12 Jan 2021 10:24:59 -0500 Subject: [PATCH] Don't trigger udev if socket doesn't exist On rpm-ostree systems, we don't want scriptlets to affect the running system because a major part of the value is "background updates". Scriptlets are run in a containerized environment where e.g. udev is not available. Add a check for the udev socket before triggering it to handle this. This also helps the container use case. This doesn't break rpm-ostree strictly, because it uses `|| :`, but it still spams error messages during the compose. I kept the `|| :` to be safe, but it's likely fine to remove them now. See also: https://bugzilla.redhat.com/show_bug.cgi?id=1352154 See also: https://src.fedoraproject.org/rpms/udisks2/pull-request/3 See also: https://github.com/coreos/fedora-coreos-tracker/issues/703 https://src.fedoraproject.org/rpms/NetworkManager/pull-request/6 --- NetworkManager.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/NetworkManager.spec b/NetworkManager.spec index 24c9a6b..0a6618d 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -856,8 +856,12 @@ fi %post -/usr/bin/udevadm control --reload-rules || : -/usr/bin/udevadm trigger --subsystem-match=net || : +# skip triggering if udevd isn't even accessible, e.g. containers or +# rpm-ostree-based systems +if [ -S /run/udev/control ]; then + /usr/bin/udevadm control --reload-rules || : + /usr/bin/udevadm trigger --subsystem-match=net || : +fi %if %{with firewalld_zone} %firewalld_reload %endif