Skip to content

Commit

Permalink
[dracut] avoid 100s delay with rpm-ostree cliwrap
Browse files Browse the repository at this point in the history
When calling dracut on an rpm-ostree based system
with cliwrap enabled you get the following message:
```
This system is rpm-ostree based; initramfs handling is
integrated with the underlying ostree transaction mechanism.
Use `rpm-ostree initramfs` to control client-side initramfs generation.
rpm-ostree: Note: This system is image (rpm-ostree) based.
rpm-ostree: Dropping privileges as `dracut` was executed with not "known safe" arguments.
rpm-ostree: You may invoke the real `dracut` binary in `/usr/libexec/rpm-ostree/wrapped/dracut`.
rpm-ostree: Continuing execution in 5 seconds.
```

Calling `/usr/libexec/rpm-ostree/wrapped/dracut --print-cmdline` is
still slow because it calls rpm multiple times which is also a wrapped
cli. Call dracut with the env variable RPMOSTREE_CLIWRAP_SKIP to avoid
the 5s waits. This is safe because we only use read only commands.

With rpm-ostree v2024.4 `rpm --eval` is marked as safe, so we don't
have the 5s wait anymore for rpm calls
(coreos/rpm-ostree#4835)

Resolves: RHEL-33703

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
  • Loading branch information
champtar committed Apr 24, 2024
1 parent 3b15149 commit 3d69d4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sos/report/plugins/dracut.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ def setup(self):
self.add_cmd_output([
"dracut --list-modules",
"dracut --print-cmdline"
])
], env={"RPMOSTREE_CLIWRAP_SKIP": "true"})

# vim: set et ts=4 sw=4 :

0 comments on commit 3d69d4b

Please sign in to comment.