I have a computational task running for a few days on a linux server via SSH connection. It is not on the background, so the SSH connection is under hold of the task.
I want to restart the local machine (not the server) from which I have opened ssh session, but want to keep the task running. Is that any possible?
Best Answer
If your task is already launched, it is too late
*
to consider alternative solutions that insert an additional layer between yourssh
session and the shell running the command, likescreen
,tmux
,byobu
,nohup
and the likes.If your process support to be placed in the background and particularly doesn't hang when
stdout
andstderr
are unwritable/closed, you can put it in the background before logging out with ControlZ andbg
then detach it from your shell with thedisown
builtin.eg:
*
As Bob commented, there are actually several hackish ways to reparent a tty session under Linux. repty, retty, injcode and neercs. The most advanced looks to be reptyr but you might need root privileges to enable ptrace to hack your process.