diff --git a/board/common/rootfs/usr/sbin/container b/board/common/rootfs/usr/sbin/container index 8fa8f6eb..bd3eebb2 100755 --- a/board/common/rootfs/usr/sbin/container +++ b/board/common/rootfs/usr/sbin/container @@ -273,6 +273,7 @@ commands: create NAME IMAGE NET Create container NAME using IMAGE with networks NET delete [network] NAME Remove container NAME or network NAME from all containers exec NAME CMD Run a command inside a container + flush Clean up lingering containers and associated anonymous volumes find [ifname PID] Find PID of container where '--net IFNAME' currently lives or, find the name of our IFNAME inside the container @PID help Show this help text @@ -425,6 +426,10 @@ case $cmd in exec) podman exec -it "$@" ;; + flush) + echo "Cleaning up any lingering containers"; + podman rm -av + ;; find) cmd=$1 pid=$2 diff --git a/package/execd/execd.conf b/package/execd/execd.conf index 1c4b5625..1a8da3b8 100644 --- a/package/execd/execd.conf +++ b/package/execd/execd.conf @@ -1,2 +1,4 @@ +task log:prio:local1.notice,tag:container-flush \ + [S] container flush -- Cleaning up lingering containers service log:prio:local1.err,tag:container \ [2345] execd /run/containers/queue /run/containers/active -- Container job runner