[GLLUG] ssh hangs on remote shutdown

Jeremy Bowers jerf at jerf.org
Mon Jan 5 12:02:40 EST 2004


Scott Harrison wrote:
> Hi:
> 
> An ongoing phenomenon I have noticed is:
> 
> [invokingshell %] ssh user at remotemachine
> [remotemachine %] shutdown -r +2 &
> [remotemachine %] exit (or Ctrl-D)
> 
> The ssh session hangs on me, not returning me to the invoking shell.
> 
> I have noticed this throughout the years and am right now
> witnessing this with Mandrake 9.2.
> 
> Help stop hung terminals!  Anybody else know what's going
> on and/or has investigated this?

I've only seen this when you have forwarded ports still being used. The 
TCP connection itself should actually be dead after shutdown which 
should eventually be reported to the ssh client.

That said, ssh should respond to its escape sequences if your concern is 
just to get the shell back, as described in "man ssh". (Short version: 
Newline, tilde, period should cause a disconnect.) (Note I read the man 
page I don't know how many times before the existance of escape 
sequences sunk in, so no implied insult intended.)

If your ssh fails to respond to *that*, then you've got a legitimate bug 
on your hands.




More information about the linux-user mailing list