[Gllug] Re-access broken remote connection to process?

Nix nix at esperi.org.uk
Sat Jun 19 22:12:16 UTC 2010

On 17 Jun 2010, t. clarke said:

> I have not used SSH,


>                       but if its anything like telnet, once a connection is lost
> the process normally dies, or remains running but inaccessible since the socket
> to which it is connected no longer exists.

Uh, that's if it's *broken*. If the physical network layer is down and keepalives
are off, the TCP connection will stay up-but-inactive forever, and so will the
SSH session.

But the problem here is one of connecting an existing process to a
different TTY, and unfortunately it's really difficult: TTYs contain a
*lot* of state, most of which is tucked away inside the kernel and
inaccessible.  The only way to do it is to connect it to a proxying PTY
when you set it up, which can then be connected to whatever TTY you like
later on. This, of course, is what screen(1) does when you detach it:
but if you didn't think to start screen before your monster SSH session,
you might as well just kill the thing and reconnect.
Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list