hang on exit bug under Linux

Markus Friedl markus at openbsd.org
Tue Dec 11 07:15:13 EST 2001


On Mon, Dec 10, 2001 at 10:00:44AM -0800, Michael wrote:
> > On Fri, Dec 07, 2001 at 08:20:55PM -0800, Michael wrote:
> > > so what about connections that are made from a script??
> > 
> > the so-called bug is only related to sessions with ptys.
> > 
> > you don't use ptys with scripts, so there is no problems
> > for scripts.
> > 
> 
> That's not true. Example:
> 
> on the target host running openssh sshd daemon
> 
> #!/usr/bin/perl
> while(1) {
>   sleep 1;
> }
> # end
> 
> on the client, with no password required
> 
> #!/bin/sh
> /usr/localbin/ssh targethost "/usr/bin/perl tstprog.pl &"
> # end
> 
> the script hangs and never returns because sshd will not close its 
> connection to the client. Seems whenever STDOUT or STDERR may return 
> info, sshd will not detach as other programs such as telnet, rsh, 
> ssh-1.2x, etc.. are happy to do.

rsh does not always, it might do on some systems, but that is IMHO
incorrect behaviour.

use
	$ rsh targethost -n "/usr/bin/perl tstprog.pl >/dev/null 2>&1 &"
or
	$ ssh targethost -n "/usr/bin/perl tstprog.pl >/dev/null 2>&1 &"

-m



More information about the openssh-unix-dev mailing list