From: Yu Watanabe Date: Thu, 31 Jul 2025 23:29:19 +0000 (+0900) Subject: TEST-13-NSPAWN: wait for a few seconds after markers found X-Git-Tag: v257.8~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=671fcff62d2a61b04b37c6061cae418f73a6f40b;p=thirdparty%2Fsystemd.git TEST-13-NSPAWN: wait for a few seconds after markers found Otherwise, the scope that the nspawn container belonging to may be removed before the grandchild process of the machined exits and it may be SIGKILLed. ``` [ 100.829613] systemd-machined[678]: Successfully forked off '(sd-bindmnt)' as PID 2962. [ 100.833366] systemd-nspawn[2953]: Inner child finished, invoking payload. [ 100.836111] (sd-bindmnt)[2962]: Skipping PR_SET_MM, as we don't have privileges. [ 100.836401] (sd-bindmnt)[2962]: Successfully forked off '(sd-bindmnt-inner)' as PID 2964. [ 100.846498] (sd-bindmnt)[2962]: (sd-bindmnt-inner) terminated by signal KILL. [ 100.848846] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: cgroup is empty [ 100.849303] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: Deactivated successfully. [ 100.849317] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: Changed running -> dead [ 100.849752] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: Consumed 91ms CPU time, 1.3M memory peak. [ 100.850399] systemd-machined[678]: (sd-bindmnt) failed with exit status 1. [ 100.850414] systemd-machined[678]: Child failed. [ 100.854574] systemd-machined[678]: Failed to mount /tmp/marker-varlink on /tmp/marker-varlink in the namespace of machine 'TEST-13-NSPAWN.machinectl-bind.7ye': Protocol error ``` Hopefully fixes #38434. (cherry picked from commit 7b20a5cbf33f0ec29613e29c69803310e51a3212) --- diff --git a/test/units/TEST-13-NSPAWN.nspawn.sh b/test/units/TEST-13-NSPAWN.nspawn.sh index c827d9cda73..a0e72dd1d0d 100755 --- a/test/units/TEST-13-NSPAWN.nspawn.sh +++ b/test/units/TEST-13-NSPAWN.nspawn.sh @@ -796,7 +796,7 @@ EOF testcase_machinectl_bind() { local service_path service_name root container_name ec - local cmd='for i in $(seq 1 20); do if test -f /tmp/marker; then exit 0; fi; sleep .5; done; exit 1;' + local cmd="timeout 10 bash -c 'until [[ -f /tmp/marker ]]; do sleep .5; done'; sleep 3" root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.machinectl-bind.XXX)" create_dummy_container "$root"