fix(cli): prevent double SIGTERM dispatch when both SIGINT and SIGTERM arrive
The forward handler now self-removes both listeners before calling killProcessTree, so a second signal cannot invoke it again on an already-dead PID. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ec3349454b
commit
d96a11a1c7
|
|
@ -1148,6 +1148,8 @@ async function runStartup(
|
|||
// SIGINT/SIGTERM so the dashboard group is also cleaned up on exit.
|
||||
if (!isWindows() && pid) {
|
||||
const forward = (): void => {
|
||||
process.off("SIGINT", forward);
|
||||
process.off("SIGTERM", forward);
|
||||
void killProcessTree(pid, "SIGTERM");
|
||||
};
|
||||
process.once("SIGINT", forward);
|
||||
|
|
|
|||
Loading…
Reference in New Issue