Skip to content

Commit

Permalink
redhat/spec: 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 `|| true`, but
it still spams error messages during the compose. I kept the `|| true`
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

Signed-off-by: Jonathan Lebon <jonathan@jlebon.com>
  • Loading branch information
jlebon committed Jan 27, 2021
1 parent 9a4b175 commit 2bce019
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redhat/rdma-core.spec
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ rm -rf %{buildroot}/%{_initrddir}/
rm -f %{buildroot}/%{_sbindir}/srp_daemon.sh

%post -n rdma-core
if [ -x /sbin/udevadm ]; then
if [ -x /sbin/udevadm ] && [ -S /run/udev/control ]; then
/sbin/udevadm trigger --subsystem-match=infiniband --action=change || true
/sbin/udevadm trigger --subsystem-match=net --action=change || true
/sbin/udevadm trigger --subsystem-match=infiniband_mad --action=change || true
Expand Down

0 comments on commit 2bce019

Please sign in to comment.