ssh remoting: Daemonize server process properly by forking and closing stdio (#19544)

This fixes the `ssh` proxy process not being notified when the proxy
process dies. Turns out that the server would have stdout/stderr/stdin
connected to the grand-parent ssh process connected to it and as long as
the server kept running (even once it was daemonized into the
background) the grand-parent ssh process wouldn't exit.

That in turn meant that the Zed client wasn't notified when the proxy
process died.

Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
Thorsten Ball 2024-10-22 16:36:40 +02:00 committed by GitHub
parent f16461d7d0
commit b3aa7055e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 63 additions and 10 deletions

View file

@ -53,6 +53,10 @@ smol.workspace = true
util.workspace = true
worktree.workspace = true
[target.'cfg(not(windows))'.dependencies]
fork.workspace = true
libc.workspace = true
[dev-dependencies]
client = { workspace = true, features = ["test-support"] }
clock = { workspace = true, features = ["test-support"] }