mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-11-06 08:15:35 +00:00
Found by running a real `tty7 server restart`. The old gateway did exit, because the new image's supervisor started its own gateway and the old one lost the lock. But it was left as a zombie: the image after the exec never reaps a child it did not start, so each handoff leaked a process entry. `hand_over` now calls `daemon::mobile::stop_for_handoff` before the exec, which closes the gateway's stdin and waits for it. A flag keeps the supervisor from starting another in the moments before the exec, and `handoff_failed` clears the flag if the exec never happens, so the daemon goes on serving. Checked with two handoffs in a row (tty7-app → tty7-server → tty7-server): - each old gateway was reaped, with no zombies system-wide; - exactly one fresh gateway was running after each handoff; - the pane's shell and its environment survived; - the probe phone kept working.