hang on exit bug under Linux

Michael michael at bizsystems.com
Wed Dec 12 13:31:17 EST 2001


> 
> 
> On Tue, 11 Dec 2001, Michael wrote:
> 
> > > > If you run openssh, like the following:
> > > >
> > > > ssh remotehost "foreverSleep &"
> > > >
> > > > Should and does hang (fsecure hangs as well).
> > > >
> > > > HOWEVER,
> > > >
> > > > ssh remotehost
> > > > # foreverSleep &
> > > > # exit
> > > >
> > > > DOES hang. (fsecure does not hang) This is where the bug is. If you run ssh with a tty and in interactive mode, if the client decides to disconnect, it disconnects cleanly (I'm not sure about what happens to the remaining processes, you will have
 to
> > look at rsh code for that -- it may be SIGHUP or something, i dunno -- other posts may be clearer on this).
> > >
> >
> > A real example would be a perl program that runs as a daemon
> > #!/usr/bin/perl
> > unless ($pid = fork) {
> >    unless (fork) {
> >        open(SDOUT,'>/dev/null');
> >        open(STDERR,'>/dev/null');
> Perl opens STDIN also.  So it should hang very nicely.
> 
> - Ben
> 
Oops ! {blush} ....ur right

I'd really like to be able to have and sshd daemon that would boot 
the client off the machine and exit when it receives a close after 
starting a faulty daemon. I'm not keen about having many waiting 
sshd's in the process table because users don't clean up after 
themselves. This really is the issue, not what is truly right or 
wrong. I really don't think everyone will every agree. I'd be most 
happy even with an option with which I could configure MY sshd's to 
dump the user unconditionally if it receives a request to disconnect 
and the process is backgrounded. Giving the sysop the option to set 
things up that way would go a long way toward solving the problem 
until the "world" comes to an agreement on the true solution.

Michael
Michael at Insulin-Pumpers.org



More information about the openssh-unix-dev mailing list