Hi Aaron,

On May 3, 10:35am, Aaron Holtz wrote:
> Subject: (RADIATOR) Trying to deal with DNS restart
> Howdy.  I'm using the %C expansion (DNS name of NAS unit) as part of my
> AcctLogFileName (AcctLogFileName %L/%C/detail).  When I restart my name
> server at 3am each day (to clear out bad cached answers, etc.) any logs I
> take in those few seconds during restart cause the expansion to fail -
> hence everything ends up in the same detail file.  I'm trying to make a
> change to Handler.pm to work around that.  Here is what I've inserted
> around line 390 or so in Handler.pm:
>
> ## New Stuff.  Trying to deal with the 3am DNS restart
>
>                 if ( $filename eq "/usr/adm/radacct//detail" ) {
>                         sleep 60;
>                         my $filename =
>                               &main::format_special($acctFileName, $p);
>                 }
>
>                 if ( $filename eq "/usr/adm/radacct//detail" ) {
>                         $acctFileName = "/usr/adm/radacct/\%N/detail";
>                         my $filename =
>                               &main::format_special($acctFileName, $p);
>                 }
>
> ## End New Stuff
>
>
> Basically it looks to see if the returned filename is missing the %C
> expansion.  If so, it sleeps for 60 seconds and tries again.  If that
> failed then I'm guessing I forgot to put that NAS unit in DNS or the
> nameserver still isn't accepting queries.  If that is the case then I
> change the expansion to be %N (the NAS units IP address.)  This should
> allow me to have a good detail file for each unit during that time period
> and I can also spot any units that may not be DNS as they'd have an IP
> address for the directory name.  My two questions are this:
>
> 1.  Will this code work?  I'm mostly concerned about the \%N I put in
>     there - I'm assuming the \ is necessary to avoid errors.  Also,
>     is that the match I should be looking for to see that %C has failed?
You dont need the my declarations on the $filename variables, and you will
probably have to have it on the acctFileName variable, but it looks OK (i
havent tested it though).
Obviously, your Radiator will stop handling queries for the period of the
sleep. Is that OK?

>
> 2.  Does the 'sleep' basically "vapor lock" radiator during that time
>     period or is a new invocation of Handler.pm run for each incoming
>     request?  It is only 60 seconds, but if I do fail to put a unit in
>     DNS I don't wait to hold up everything for every request I take from
>     that unit during the busy times.
It will stop everything for the 60 secs.

>
>
> I could always use the %N from the start and avoid this problem, but
> with 350 units logging it does make it MUCH easier to find something
> specific if the need arises.  Thanks in advance.
Hope that helps.

Cheers.


-- 
Mike McCauley                               [EMAIL PROTECTED]
Open System Consultants Pty. Ltd            Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia   http://www.open.com.au
Phone +61 3 9598-0985                       Fax   +61 3 9598-0955

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8, 
NT, Rhapsody
===
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to