Skip to content

Commit

Permalink
Don't trigger udev if socket doesn't exist
Browse files Browse the repository at this point in the history
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: coreos/fedora-coreos-tracker#703

https://src.fedoraproject.org/rpms/NetworkManager/pull-request/6
  • Loading branch information
jlebon authored and thom311 committed Jan 14, 2021
1 parent 85ab70f commit 3240dc5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions NetworkManager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3240dc5

Please sign in to comment.