so-called-hang-on-exit

Frank Cusack fcusack at fcusack.com
Tue Aug 6 16:20:53 EST 2002


How does the client know the pty has been flushed and it's not just that
sshd has not set the right bit in the select mask (since it does or does not
set it according to some heuristic)?  ie, just b/c the client isn't getting
data doesn't mean the pty has been flushed.  Right?

/fc

On Mon, Aug 05, 2002 at 04:31:26PM -0400, Nicolas.Williams at ubsw.com wrote:
> 
> Fair enough on the flushing of the pty. But sshd should still
> not close the pty - it should wait for the background processes
> to exit and/or dissassociate from the pty.
> 
> The client does know that there are background processes left
> still holding the pty open. How? Because the client requested
> and got a pty, the sshd has sent a session-exit message, and
> the channel is still open.
> 
> Cheers,
> 
> Nico
> -- 
> 
> > -----Original Message-----
> > From: Jani Jaakkola [mailto:jjaakkol at cs.Helsinki.FI]
> > Sent: Monday, August 05, 2002 4:20 PM
> > To: Williams, Nicolas
> > Cc: openssh-unix-dev at mindrot.org
> > Subject: RE: so-called-hang-on-exit
> > 
> > 
> > On Mon, 5 Aug 2002 Nicolas.Williams at ubsw.com wrote:
> > 
> > > 
> > > I still think this sort of thing should be done by the client.
> > > 
> > > The client knows everything that the server knows.
> > 
> > Except this time is does not. If there is background 
> > processses on the 
> > tty, the client can either close the session and lose data or wait 
> > indefinetely for data from the background processes.
> > 
> > > So the client
> > > can choose to terminate the SSHv2 session when the PTY session
> > > process leader exits - and it can implement any other termination
> > > heuristic you wish too.
> > 
> > It needs server modifications that data from the pty session process 
> > leaders is not lost. I think rlogin and all other pty using 
> > programs have 
> > allready implemented this properly; which is that the pty buffer is 
> > first emptied and the connection is closed _after_ that.
> > 
> > - Jani



More information about the openssh-unix-dev mailing list