hang on exit bug under Linux

Peter Stuge stuge at cdy.org
Fri Dec 14 11:58:42 EST 2001


On Thu, Dec 13, 2001 at 05:35:49PM +0100, Wichert Akkerman wrote:
> Previously John Hardin wrote:
> > ...so you're saying having a "hung" ssh session is okay if it's
> > backgrounded?
> 
> It is if the backgrounded program has not disconnected itself from
> the pty.

My point exactly.  And nothing has hung.  The client is lingering, waiting
for all remote tasks to complete.  This is the same behaviour you get if you
set SO_LINGER on a socket.  Check out socket(7)..  If/when the program in
the background (on remotehost) exits, the ssh client and the sshd on the
server will also exit.  And if the xterm (or virtual console) gets closed,
the ssh client will be killed off, as the sshd on remotehost.  If the
backgrounded program on remotehost catches HUP it will stay alive, but any
data output from it will be lost.  That's however hard to change from within
ssh.

Now off to code up this patch.  Or at least I'll try, had a look at some of
the code yesterday too but didn't get anywhere..


//Peter

-- 
irc: CareBear\
irl: Peter Stuge



More information about the openssh-unix-dev mailing list