board/common: fix container network change detection on pull

When a container's image is on an inaccessible remote server, the
container wrapper script waits in the background for any netowrk
changes to retry download of the image.

This change avoids the dangerous previous construct, and is also
easier to read: timeuot after 60 seconds unless ip monitor reads
at least one event before that.

Fixes #1124

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-09-01 14:03:50 +02:00
parent 12df83e6d2
commit 66a5e5304b
2 changed files with 7 additions and 1 deletions
+5 -1
View File
@@ -782,7 +782,11 @@ case $cmd in
while ! "$script"; do
log "${name}: setup failed, waiting for network changes ..."
read -t 60 _ < <(ip monitor address route)
# Timeout and retry after 60 seconds, on SIGTERM, or when
# any network event is caught.
timeout -s TERM -k 1 60 sh -c \
'ip monitor address route 2>/dev/null | head -n1 >/dev/null' || true
# On IP address/route changes, wait a few seconds more to ensure
# the system has ample time to react and set things up for us.
+2
View File
@@ -15,6 +15,8 @@ All notable changes to the project are documented in this file.
### Fixes
- Fix #1098: Prune dangling container images to reclaim disk space
- Fix #1123: Disabling or removing a container may cause podman to hang
- Fix #1124: Container setup with unreachable remote image spawns
excessive `ip monitor` processes
[RPI-TOUCH]: https://www.raspberrypi.com/products/raspberry-pi-touch-display/