mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-04 11:08:53 +09:00
Monitor teardown SIGHUPed and SIGKILLed every remembered child group when the transport closed. sshd signals nothing at a non-PTY session end; background jobs with redirected stdio survive and reparent to init. Clients rely on that: VS Code Remote-SSH starts its remote server as a plain background job in the session's group and expects it to outlive connection drops, and tailscale upgrades run as non-PTY execs whose work should survive a daemon restart. Now only SSHTerminationError causes (revocation, session-duration, recording failure) kill the process tree. Everything else — client disconnect, daemon shutdown — closes I/O without signals: PTY masters close and the driver SIGHUPs the foreground group, non-PTY processes exit on EOF and SIGPIPE or keep running. Monitor teardown kills only forwarding children, unless revocation armed the new kill-all op first, since its per-session kicks race the close. No zombie leak: the monitor reaps its table, and reparented survivors are reaped by init. Fixes #22076 Signed-off-by: James Tucker <james@tailscale.com> Change-Id: I70b4ef40035330dd542d256ba79d889a12426a74