From 60b7a7360895cfa999bc3e15d790557ae8cb0e95 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Jan 29 2021 08:47:31 +0000 Subject: 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. 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 --- diff --git a/wireshark.spec b/wireshark.spec index daa8e7b..c2a1f9c 100644 --- a/wireshark.spec +++ b/wireshark.spec @@ -184,7 +184,11 @@ getent group usbmon >/dev/null || groupadd -r usbmon %post cli %{?ldconfig} -/usr/bin/udevadm trigger --subsystem-match=usbmon +# 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 trigger --subsystem-match=usbmon +fi %ldconfig_postun cli