mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
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 <albinker@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user