stop/start causes hang in Perl script

Russ Allbery rra at stanford.edu
Sun Dec 19 21:27:59 UTC 2004


Felix E Klee <felix.klee at inka.de> writes:

> I found the problem now.  It has nothing to do with the PIDs.  Instead
> it's the old peeve with stdout not being closed.  For example the
> following line causes Perl (or BASH) to hang for 60 seconds although
> sleep goes in the background:

> `sleep 60 &`

> The solution is to close stdout.  This line executes without noticeable 
> delay:

> `sleep 60 >/dev/null &`

> In the rc.news script the following lines are found:

>     ( sleep 60 ; ${INNWATCH} ) &
>     ( sleep 60 ; ${PATHBIN}/cnfsstat -s -l -P ) &

> I added "> /dev/null" to these lines in a copy of rc.news:

>     ( sleep 60 ; ${INNWATCH} ) >/dev/null &
>     ( sleep 60 ; ${PATHBIN}/cnfsstat -s -l -P ) >/dev/null &

> When using that copy in my original script, the problems are gone.

> I say that the missing redirection to ">/dev/null" is a bug.  What d'you
> think?

Yup, I agree.  Fixed in CVS.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list