The only potential problem I see, if you have multiple vega servers, and
one is down. None of your updates get made. :(... 


> -----Original Message-----
> From: Bill Shupp [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 23, 2004 12:11 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [users] update-data.sh
> 
> Bob Hutchinson wrote:
> 
> >On 23/09/04 00:17, Bill Shupp wrote:
> >
> >
> >>Darrel O'Pry wrote:
> >>
> >>
> >>>I ran into a problem the other day on a testing server. Apache was
> >>>stopped on the server hosting vegaDNS, and well I lost DNS to the
whole
> >>>test bed for a little bit :). Easy enough to fix in the situation,
> >>>restart apache and all is well, but losing dns for a bit can blow
if
> you
> >>>have a good number of users. I made some changes to update-data.sh
to
> >>>avoid this, kind of dirty. I was wondering if anyone else had a
better
> >>>idea, or anything I overlooked to avoid this particular problem.
This
> >>>solution will keep the original DNS for any servers that are
> >>>unavailable.
> >>>
> >>>
> >>>for VD in $VEGADNS ; do
> >>>   A=$[$A+1]
> >>>   if wget -q -O "$TINYDNSDIR/root/data.srv-$A.tmp"
$VD?state=get_data;
> >>>then
> >>>       mv $TINYDNSDIR/root/data.srv-$A.tmp
$TINYDNSDIR/root/data.srv-$A
> >>>   fi
> >>>   cat "$TINYDNSDIR/root/data.srv-$A" >>$TINYDNSDIR/root/data
> >>>done
> >>>
> >>>.darrel.
> >>>
> >>>
> >>Yeah, I agree there should be a check for the exit code of wget.
I'll
> >>add this to the the next release.
> >>
> >>But for the code above, shouldn't your "fi" be below the "cat" line?
> >>
> >>
> >
> >Also, a test for filesize might not be amiss, I have had a zero size
data
> >appear when the mysql server was down :-(
> >
> >if [ -s "$TINYDNSDIR/root/data.srv-$A.tmp" ]; then
> >     # do it
> >fi
> >
> >
> 
> Ok, I have updated update-data.sh to cp the data file, rather than
move
> it (in case later processing fails).  All further processing is done
on
> data.new, rather than data.  It also checks the return status of wget,
> as well as the file size of the resulting data file for EACH   VegaDNS
> server.  If any fail or result on a 0 size file, update-data.sh
> generates and error and exits.
> 
> Anyone see any problems with the new attached script?
> 
> Regards,
> 
> Bill
> 
> --
> Incoming mail is certified Virus Free.
> Checked by AVG Anti-Virus (http://www.grisoft.com).
> Version: 7.0.269 / Virus Database: 264.9.5 - Release Date: 9/22/2004
> 
> 

-- 
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.269 / Virus Database: 264.9.5 - Release Date: 9/22/2004
 

Reply via email to