hang on exit bug under Linux

Bob Proulx bob at proulx.com
Tue Dec 11 04:57:33 EST 2001


> so try this, guaranteed to hang the exit of the session for 
> openssh, but ssh-1.2.27 likes it fine.
> file tst.pl
> #!/usr/bin/perl
> while (1) {
>   sleep 1;
> }
> # end
> at the keyboard, just type
> > perl tst.pl &
> > exit
> This means that a daemon can never be stopped and restarted from the 
> keyboard without a hang or screwing around with special exit 
> procedures. Looks, sounds, smells like a bug to me.

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.

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?

Bob



More information about the openssh-unix-dev mailing list