Skip to content

Keep long-running WSL processes alive after SSH disconnect #1464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sskeirik opened this issue Sep 25, 2019 · 2 comments
Closed

Keep long-running WSL processes alive after SSH disconnect #1464

sskeirik opened this issue Sep 25, 2019 · 2 comments

Comments

@sskeirik
Copy link

"OpenSSH for Windows" version
7.7.2.2

Server OperatingSystem
Win 10 Pro

Client OperatingSystem
Win 10 Pro

What is failing
I connect to server and am dropped into CMD shell.
I run wsl.
Inside WSL, I run tmux.
I start a long-running process inside the tmux session.
I exit tmux.
I disconnect from the SSH session.
When I reconnect, the tmux process and all of its children are gone.

Expected output
The tmux process and its children should stay alive regardless if I am connected to server by SSH session.

Actual output
The tmux process dies sometime after disconnecting from the SSH session.

Related Issues (but these issues do not mention WSL processes):
#1418 #1032

@sskeirik sskeirik changed the title process Keep long-running WSL processes alive after SSH disconnect Sep 25, 2019
@WSLUser
Copy link

WSLUser commented Oct 31, 2019

Use screen. WSL should keep sessions open assuming there's a WSL window still open on the remote machine (or even local). Once all sessions are closed, it's by design in WSL to kill processes. Only configured background tasks should remain running if they are meant to continuously run.

@lfourquaux
Copy link

Use screen. WSL should keep sessions open assuming there's a WSL window still open on the remote machine (or even local). Once all sessions are closed, it's by design in WSL to kill processes. Only configured background tasks should remain running if they are meant to continuously run.

screen and tmux do roughly the same thing, and @sskeirik is using tmux. WSL is here mostly as a use case. The issue is that all descendant processes are killed when the ssh connection closes, and preventing this is possible but far from easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants