stop/start causes hang in Perl script

Felix E. Klee felix.klee at inka.de
Sat Oct 16 20:27:58 UTC 2004


On Fri, 15 Oct 2004 22:06:29 -0400 Jeffrey M.Vinocur wrote:
> > ~> ps aux|grep -i innd
> > news     18195  0.1  1.9  7796 3680 ?        S    23:31   0:00 
> > /usr/lib/news/bin/innd -p 3
> 
> And when it hangs, what happens if you telnet to the server (port 119)? 
>   What if you try running `ctlinnd mode`?

Yes, this worked.
 
> I've never seen this before, but it sounds a little bit like there's 
> something wrong with the .pid files stored in PATHRUN, almost as if the 
> shutdown script is seeing the wrong PIDs when it looks.

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?

Felix


More information about the inn-workers mailing list