TEST-13-NSPAWN: trivially kill all processes in the container on termination

Follow-up for 841988f80d.

No functional change, as $PID is 0 when the trap is inserted.
This commit is contained in:
Yu Watanabe
2024-10-31 10:59:14 +09:00
parent 1856ab4503
commit f0fdefc045
+4 -4
View File
@@ -39,10 +39,10 @@ cat >/var/lib/machines/long-running/sbin/init <<\EOF
PID=0
trap "touch /terminate; kill $PID" RTMIN+3
trap "touch /poweroff" RTMIN+4
trap "touch /reboot" INT
trap "touch /trap" TRAP
trap 'touch /terminate; kill 0' RTMIN+3
trap 'touch /poweroff' RTMIN+4
trap 'touch /reboot' INT
trap 'touch /trap' TRAP
trap 'kill $PID' EXIT
# We need to wait for the sleep process asynchronously in order to allow