[openssh-unix-dev] Re: SSH connection hanging on logout

David Bronder david-bronder at uiowa.edu
Thu May 10 15:26:08 EST 2001


Damien Miller wrote:
> 
> On Wed, 9 May 2001 mouring at etoh.eviladmin.org wrote:
> 
> > But your right.  This does not solve protocol 1 hang on exit.  It just
> > solves protocol 2 which is a hint that it's the wrong solution.
> >
> > I must point out that this 'work around' is only required for a LIMITED
> > number of platforms.  Which I believe is HP/UX and Linux at this point.
> > Which leads me to believe their is something unique to those platforms.
> > So it may cause failure on platforms that don't require this work around.
> 
> I suspect that the problem may be with the Linux kernel itself and how it
> handles filedescriptiors shared between processes. OpenBSD and Solaris
> don't exhibit the problem, the sshd child's fds to the shell get properly
> closed when it exits.

I can confirm that the hang-on-exit problem also occurs under AIX 4.3.3.
Drove me nuts, too, until I realized that it was newmail (from elm)
that was holding open the pty.  (See below.)

> > My fear is by putting this into the CVS tree even the portable version
> > only that we will end up with another 2.3.0pX feasco.  Where we suddenly
> > learned what the downfall of the patch is months after the patch is
> > applied and almost forgotten about.
> 
> yeah - I would much prefer an (avoidable) hang on logout to a potential
> data loss.

Yes, but I agree with others that the hang on logout is not exactly the
correct behavior, either.  As has been pointed out, other remote login
services seem to correctly handle this situation, but OpenSSH does not.

In addition, the "avoidable" hang can sometimes be very non-intuitive to
track down.  My problem with newmail threw me because newmail isn't run
as a background process; it does it's own fork/exec and ends up with init
as it's parent, but it still hangs OpenSSH for up to a minute or longer.

=Dave

-- 
Hello World.                                    David Bronder - Systems Admin
Segmentation Fault                                     ITS-SPA, Univ. of Iowa
Core dumped, disk trashed, quota filled, soda warm.   david-bronder at uiowa.edu



More information about the openssh-unix-dev mailing list