so-called-hang-on-exit

Jani Jaakkola jjaakkol at cs.Helsinki.FI
Wed Aug 7 17:50:30 EST 2002


On Tue, 6 Aug 2002, Ben Lindstrom wrote:

> 
> On Tue, 6 Aug 2002, Carl Brewer wrote:
> 
> [..]
> > > since ~ will unconditionally close a terminal window, what's wrong with a
> > > config option to do this automagically if the sysadmin wishes to configure
> > > sshd in this fashion. Give me a good reason (other than academic) why when
> > > the user or script says "bye now" that sshd should not take them
> > > seriously.
> >
> > Not to mention the complexity of multiple chained ssh connections, how
> > many "~'s do I need to press?  I'm chained in through how many sessions
> > again?
> >
> > Unfortunatly, Michael, you're wasting your time.  None of the
> > developers will see it from a 'real user' perspective.  Purity
> > vs practicality, and purity wins.
> >
> 
> Your going to have to excuse me. I just got back into town after a
> wirlwind trip, but I don't think you are qualify to say that.
> 
> The question that has yet to be answered is.
> 
> *WHY* does it happen on some platforms and not others?  You run OpenSSH on
> OpenBSD?  No hang.

Then OpenBSD must already have the data loss problem. Which means that 
OpenBSD kernel does the decision, that the pty is not needed any more 
when the pty session master process exits and therefore it is OK to force 
the pty closed (I vaguely remember that some ancient Linux kernel had 
the same behaviour, but I might be mistaken).

And so already for OpenBSD users the data from the pty background 
processes might and will be lost, unless someone patches OpenBSD kernel.

On Linux and on other system the user space process can decide whether to 
wait for the background processes or not. Currently sshd forces the 
decision to be "wait". IMHO, it would be more useful to default to "do 
not wait for background processes" (again, just like OpenBSD already 
does) and provide an option for those users who actually want to wait for 
them.

> No one has yet to even explain to us why.  

This should be easy enough to check from OpenBSD kernel. However since I 
am a Linux guy I do not have OpenBSD kernel handy would not know where to 
look.

- Jani




More information about the openssh-unix-dev mailing list