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?
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.
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.
--------------------------------------------------------------------------
Aaron Holtz
ComNet Inc.
UNIX Systems Specialist
Email: [EMAIL PROTECTED]
"It's not broken, it just lacks duct tape."
--------------------------------------------------------------------------
===
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.