hang on exit bug under Linux

Nicolas Williams Nicolas.Williams at ubsw.com
Tue Dec 11 06:02:12 EST 2001


On Mon, Dec 10, 2001 at 10:50:06AM -0800, Dan Kaminsky wrote:
> > That is not a proper daemon program and therefore not a good example
> > of a problem.  Proper daemons should always close any tty file
> > descriptor, detach from any controlling terminals, call setsid() to
> > form a new process group, etc.  This is more representative of a
> > program that could loose data.
> 
> So I've got all these Windows 9x machines that won't shut down.  Have to
> power cycle them every time, or leave them on 24/7.  Rather wasteful of
> power, and you risk your file system every time you decide to go through
> with it.  It's one of the worst parts of 9x.
> 
> Look: ssh user at host "command" needs to never, ever hang.  It needs to not
> leave processes running, it needs to not break scripts, it needs to simply
> be "this command, as if it was run locally, only it's really somewhere else.
> And if I'd be staring at a prompt somewhere else, damnit, I need to be
> staring at a prompt here."
> 
> I've gotten critical pages at three in the morning from irate sysadmins half
> the world over wondering why I'm taking up most of the load on their machine
> as a side effect of this class of bugs.  Lemme tell you, stuff like that
> puts a damper on my ability to evangelize SSH :-)

This could (should?) be handled with an option to the client to close
the session as soon as possible, perhaps with a timer. Don't use a pty
so your remote command won't get SIGHUP though!

Hey, I have the same problem to deal with. I deal with it. I always put
in explicit stdio redirections to/from /dev/null. What's wrong with that?

> > Perhaps one of the reasons this issue has been hard to get agreement
> > on is that everyone is testing with different daemons and some of
> > those are ill behaved?
> 
> I think it's mostly a cross platform issue.  Ugliness always hides at the
> fringes, and the exact set of behavior that signifies "this app is closed"
> has the exact feel of a fringe.
> 
> Yours Truly,
> 
>     Dan Kaminsky
>     DoxPara Research
>     http://www.doxpara.com
> 


Cheers,

Nico
--
-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.




More information about the openssh-unix-dev mailing list