From 12df83e6d2ab1286cfa59463bb6851cbf40fff8d Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 29 Aug 2025 15:41:46 +0200 Subject: [PATCH] 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 --- .../rootfs/etc/finit.d/available/container@.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/board/common/rootfs/etc/finit.d/available/container@.conf b/board/common/rootfs/etc/finit.d/available/container@.conf index f3a5b0e3..7a494c60 100644 --- a/board/common/rootfs/etc/finit.d/available/container@.conf +++ b/board/common/rootfs/etc/finit.d/available/container@.conf @@ -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