From ac72262accdfa76a56de88028a92dd1cc3b342f8 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 17:33:27 +0000 Subject: [PATCH] fix(marmot-interop): clean up daemons on Ctrl+C in interactive harness Apply the same SIGINT/SIGTERM/SIGHUP trap hardening to the interactive harness that just landed on the headless one. Without it, killing the script mid-run leaves the nohup'd wn daemons alive and the next run fails in preflight because the sockets are still held. --- tools/marmot-interop/marmot-interop.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/marmot-interop/marmot-interop.sh b/tools/marmot-interop/marmot-interop.sh index ec999d87f..a150f3c97 100755 --- a/tools/marmot-interop/marmot-interop.sh +++ b/tools/marmot-interop/marmot-interop.sh @@ -925,7 +925,20 @@ test_14_push_notifications() { # ==== main =================================================================== main() { - trap 'stop_daemons; print_summary' EXIT + # Make sure Ctrl+C / SIGTERM / SIGHUP all run the full cleanup path — + # otherwise wnd is nohup'd and keeps running after the script dies. + # Trap INT/TERM/HUP forces `exit`, which triggers the EXIT handler once. + cleanup() { + local rc=$? + trap - EXIT INT TERM HUP + stop_daemons + print_summary + exit "$rc" + } + trap cleanup EXIT + trap 'exit 130' INT + trap 'exit 143' TERM + trap 'exit 129' HUP banner "Amethyst <-> whitenoise-rs interop harness ($RUN_TS)" preflight