From 5682f65ccaa83242c8f2cc2771ea55df95886f75 Mon Sep 17 00:00:00 2001 From: Albin Kerouanton Date: Tue, 26 Aug 2025 21:15:02 +0200 Subject: [PATCH] hack/dind-systemd: collect firewalld logs Add a systemd service 'collect-firewalld-logs.service' that copies firewalld log file into bundles/ on container shutdown. This won't provide much value for developers who run `make shell`, but it'll be useful on CI to include firewalld logs in the exported artifacts. The CI is already configured to pick every *.log file from bundles/, so no further change is needed on that side. Signed-off-by: Albin Kerouanton --- hack/dind-systemd | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hack/dind-systemd b/hack/dind-systemd index 27730774a1..1f74ad7c98 100755 --- a/hack/dind-systemd +++ b/hack/dind-systemd @@ -83,6 +83,25 @@ EOF ExecStart= ExecStart=/usr/sbin/firewalld --nofork --nopid --debug=4 EOF + + # Copy firewalld logs into the bundles/ folder on shutdown to let the CI + # include it in jobs reports. + cat > /etc/systemd/system/collect-firewalld-logs.service << EOF +[Unit] +Description=Collect firewalld logs on shutdown +After=firewalld.service + +[Service] +Type=oneshot +ExecStart=/bin/true +RemainAfterExit=true +ExecStop=cp /var/log/firewalld /go/src/github.com/docker/docker/bundles/firewalld.log + +[Install] +WantedBy=firewalld.service +EOF + + systemctl enable collect-firewalld-logs.service fi env > /etc/docker-entrypoint-env