[PATCH]: Patch to fix hang on exit bug under Linux and add optional exit delay

Ed Phillips ed at UDel.Edu
Fri Nov 16 02:44:51 EST 2001


On Thu, 15 Nov 2001, Gert Doering wrote:

> Date: Thu, 15 Nov 2001 11:32:22 +0100
> From: Gert Doering <gert at greenie.muc.de>
> To: Markus Friedl <markus at openbsd.org>,
>      Andreas Hasenack <andreas at conectiva.com.br>
> Cc: pcpa at conectiva.com.br, openssh-unix-dev at mindrot.org, openssh at openbsd.org
> Subject: Re: [PATCH]: Patch to fix hang on exit bug under Linux and add
>     optional exit delay
>
> Hi,
>
> On Thu, Nov 15, 2001 at 11:14:24AM +0100, Markus Friedl wrote:
> [..]
> > allow data loss in the server if a pty is allocated. i think
> > this would match the telnetd and rlogind behaviour best.
>
> I would accept this, and prefer it to "I have run something in the
> background that I know will not create output but fails to close
> stdin/stdout/stderr and now I can't log out cleanly".

I have more of a problem with the case where "I have no processes running
in the background and no other child processes of sshd running at all and
sshd/ssh fail to exit".  I still get that problem occasionally with
2.9.9p2... sometimes I can use CTRL-C, but sometimes I have to use SIGTERM
to get ssh to quit (and thus sshd).

> > but i'm not 100% sure, people should test their telnetd/rlogind
> > servers and check that they throw away data after the login
> > shell dies. but once again: openssh is not telnet.
>
> That's what "all implementation I'm used to" do: if I logout the
> connection is closed, no matter what background processes are still
> alive.

This is problematic... if you are forwarding X11 processes then ssh needs
to hang around (or at least fork off a child) to continue to process the X
traffic.

> The background processes will then get some kind of error (I assume
> vhangup -> I/O error or something like this) if they try to write
> something after the connection is already closed.

If ssh goes away, SIGPIPE is more likely.  If you really want to end your
session, then just kill ssh... the rest of the processes on the server
side should go away, shouldn't they?

	Ed

Ed Phillips <ed at udel.edu> University of Delaware (302) 831-6082
Systems Programmer III, Network and Systems Services
finger -l ed at polycut.nss.udel.edu for PGP public key




More information about the openssh-unix-dev mailing list