need help with named and log rotate..

Mathias Koerber mathias at staff.singnet.com.sg
Mon Mar 6 05:55:29 UTC 2000


On Sun, 5 Mar 2000, Duane Cox wrote:

| Date: Sun, 5 Mar 2000 23:31:36 -0600
| From: Duane Cox <dcox at coxnetwork.com>
| To: BING List <comp-protocols-dns-bind at moderators.isc.org>
| Subject: need help with named and log rotate..
| 
| 
| I really need some help on this named logging.. please.  I have named logging to a file named.log, which is setup in logrotate
| to rotate weekly for 52 weeks...  The problem I have is that named writes to named.log but when logrotate rotates the log,
| moves named.log to named.log.1 and creates the new named.log ... named writes to the named.log.1 and not the "new" empty file
| named.log .. Maybe named doesnt know about the log rename.. I dunno... ACK please help... below is some info.

Just add an 'ndc reload' after the rotate. named does not see that the file has been renamed
as it has it still open. ndc reload will make named close and reopen the logfiles, such that
it will then open the new file. You don't even have to create an empty file, named will do that too.

| 
| /etc/named.conf file:
| 
| options {
|         cleaning-interval 720;
|         directory "/var/named";
|         interface-interval 0;
|         pid-file "/var/run/named/named.pid";
|         notify no;
|         statistics-interval 60;
|         allow-transfer {
|                 12.15.125.5; 12.15.125.7;
|                 12.15.125.10; 12.15.125.251;
|                 };
| };
| 
| logging {
|         channel named_log {
|                 file "/var/log/named/named.log";
|                 severity info;
|                 print-category yes;
|                 print-severity yes;
|                 print-time yes;
|                 };
| 
|         category default { named_log; };
| };
| 
| 
| /etc/logrotate.d/named file:
| 
| /var/log/named/named.log {
|     missingok
|     postrotate
|         /usr/sbin/killall -HUP named
|     endscript
| }
| 
| 
| [root at orion logrotate.d]# ls -la /var/log/named  
| total 356
| drwxr-xr-x   2 named    named        4096 Mar  5 04:02 .
| drwxr-xr-x   9 root     root         4096 Mar  5 04:02 ..
| -rw-r--r--   1 named    named           0 Mar  5 04:02 named.log
| -rw-r--r--   1 named    named      349538 Mar  5 23:23 named.log.1
| 
| 
| Thanks in advance
| Duane Cox
| dcox at coxnetwork.com
| 

Mathias Koerber	  | Tel: +65 / 471 9820    |   mathias at staff.singnet.com.sg
SingNet NOC	  | Fax: +65 / 475 3273    |            mathias at koerber.org
Q'town Tel. Exch. | PGP: Keyid: 768/25E082BD, finger mathias at singnet.com.sg
2 Stirling Rd     |      1A 8B FC D4 93 F1 9A FC BD 98 A3 1A 0E 73 01 65
S'pore 148943     | Disclaimer: I speak only for myself
* Eifersucht ist eine Leidenschaft, die mit Eifer sucht, was Leiden schafft *




More information about the bind-users mailing list