On 5/6/08, David Rees <[EMAIL PROTECTED]> wrote: > 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
Excellent suggestions. Can you make these changes to your file and test? If all looks well submit a diff -rub patch and I'll get it committed. Thanks! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]