From 3a0c73d33ad40b2ed5bfb675925b1aae5edf29a3 Mon Sep 17 00:00:00 2001 From: Etienne Champetier Date: Wed, 24 Apr 2024 09:54:09 -0400 Subject: [dracut] avoid 100s delay with rpm-ostree cliwrap 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 (https://github.com/coreos/rpm-ostree/pull/4835) Resolves: RHEL-33703 Signed-off-by: Etienne Champetier --- sos/report/plugins/dracut.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sos/report/plugins/dracut.py b/sos/report/plugins/dracut.py index 0630819d..9bc25b8b 100644 --- a/sos/report/plugins/dracut.py +++ b/sos/report/plugins/dracut.py @@ -28,6 +28,6 @@ class Dracut(Plugin, RedHatPlugin): self.add_cmd_output([ "dracut --list-modules", "dracut --print-cmdline" - ]) + ], env={"RPMOSTREE_CLIWRAP_SKIP": "true"}) # vim: set et ts=4 sw=4 : -- cgit