board/common: allow containers to shut down properly

The extended kill delay (10 sec) is sometimes not enough for complex
system containers.  Also, podman sometimes take the opportunity to do
housekeeping tasks when stopping a container.  So, allow for up to 30
sec. grace period before we send SIGKILL.

With the latest image prune extension, set a 60 sec. timeout for the
cleanup task, in case podman gets stuck.  This to prevent any future
mishaps.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-09-01 14:03:50 +02:00
parent 6b0145f92e
commit 12df83e6d2
@@ -1,7 +1,7 @@
# Start a container instance (%i) and redirect logs to /log/container
# Give podman enough time to properly shut down the container. Every
# time we start a container we run the setup stage, disable the Finit
# timeout to allow the setup stage to run to completion.
sysv log:prio:local1,tag:%i kill:10 pid:!/run/container:%i.pid \
pre:0,/usr/sbin/container cleanup:0,/usr/sbin/container \
# Give podman enough time to properly shut down the container, kill:30
# The pre:script, which is responsibe for fetching a remote image, must
# not have a timeout. The cleanup should take no longer than a minute.
sysv log:prio:local1,tag:%i kill:30 pid:!/run/container:%i.pid \
pre:0,/usr/sbin/container cleanup:60,/usr/sbin/container \
[2345] <!> :%i container -n %i -- container %i