On Tue, May 6, 2008 at 11:31 AM, Scott Ullrich <[EMAIL PROTECTED]> wrote:
>  Since you appear to have some shell script knowledge check the script
>  where it reads in a couple of files.   Can you take a look at the
>  files that it reads in and tell me how many entries in the file there
>  are?
>
>  I am wondering if one of those files have grown in size to a point
>  where it can never finish processing.

All the files appear to be empty. No files are large. I suspect that
whatever triggered the issue has since resolved itself, otherwise we'd
have ping_hosts.sh scripts piling up every 5 minutes.

My best guess is that it's somehow gotten stuck in the loop reading
the config file near the top - possibly when doing the tunnel parsing.
This would make sense if the config file isn't written out atomically.

In the "while [ "$configline" != "</tunnel>" ];" loop there is an
explicit read - which doesn't appear to check to see if the read
failed or not  - unfortunately I'm not familiar enough with the while
read bash syntax to know what happens when a read fails - would have
to do a bit of research and am a bit short on time right this second.

How is the config file written to disk? Is it simply overwritten? Or
does a temporary config get generated and then linked over the
original config file?

If my theory is correct, I would suggest two fixes:

1. Make sure the config file is written atomically to the filesystem.
This means writing the file to a temporary file and then
moving/linking the temporary file over the real one.

2. Check that the read in the inner loop is successful and abort the
inner loop if not.

while [ "$configline" != "</tunnel>" ];
do
        read configline
        # check for successful read here and abort if not successful
        # inner loop code omitted for brevity
done

-Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to