From 75c96300cfbd2ee28da2b1e813c2db77a618df86 Mon Sep 17 00:00:00 2001 From: Karesansui Date: Tue, 17 Mar 2026 11:07:16 +0900 Subject: [PATCH] fix(scripts): add next-server to serve.sh cleanup trap (#1162) The cleanup() trap kills "next dev" and "next start" but not "next-server". Since "next start" forks a "next-server" child process, killing the parent may leave the child running as a zombie, holding port 3000. The startup teardown block (line 35) already handles this, but the Ctrl+C / SIGTERM trap did not. Co-authored-by: Claude Opus 4.6 Co-authored-by: Willem Jiang --- scripts/serve.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/serve.sh b/scripts/serve.sh index 6e16708..56ae502 100755 --- a/scripts/serve.sh +++ b/scripts/serve.sh @@ -92,6 +92,7 @@ cleanup() { pkill -f "uvicorn app.gateway.app:app" 2>/dev/null || true pkill -f "next dev" 2>/dev/null || true pkill -f "next start" 2>/dev/null || true + pkill -f "next-server" 2>/dev/null || true # Kill nginx using the captured PID first (most reliable), # then fall back to pkill/killall for any stray nginx workers. if [ -n "${NGINX_PID:-}" ] && kill -0 "$NGINX_PID" 2>/dev/null; then