對這文章發表回應
發表限制: 非會員 可以發表
發表者: 冷日 發表時間: 2013/11/22 6:17:24
BIND - logging file not found
[Log in to get rid of this advertisement]
I'm setting up BIND following the guidelines in the book Fedora Core 3 Unleashed. There is suggested a logging section in /etc/named.conf. I have the following
Code:
After starting the server, the following is reported:
I have created the file as shown:
The status of the service reports 'query logging is OFF'.
Does anyone have a suggestion?
Don't put it in /tmp, put it in /var/log/named, make sure /var/log/named is owned by the process that runs named.
I had the same problem with FC3, here is what I use:
The log file ends up in /var/named/chroot/var/named due to the chroot.
I still haven't been able to get the dump-file and statistics-file working though.
This is strange. I use a mix of your suggestions in the logging section:
As Technoslave suggested, I created a directory like this
A reboot followed by a 'service named stop' and 'service named start' three minutes later, resulted in the following:
1. Can someone explain to me why these two different outcomes appears?
I think I've tried both, but anyway:
2. Should I 'touch', 'chown' and 'chmod' manually to create the file or will named create the file itself if necessary?
3. Just to be sure, the user 'named' is always running the process 'named', no matter which user is logged in?
The service named starts automatically in runlevel 5.
try specifying the log file like this:
Code:
the error log is reporting "file not found" because the directory /var/named/chroot/var/log/named/ probably does not exist. Take a look at the chroot command.
[Quote]
Originally posted by Antonius_Block
the error log is reporting "file not found" because the directory /var/named/chroot/var/log/named/ probably does not exist.
[/Quote]
Thanks, no errors during start-up now.
原文出處: BIND - logging file not found
[Log in to get rid of this advertisement]
I'm setting up BIND following the guidelines in the book Fedora Core 3 Unleashed. There is suggested a logging section in /etc/named.conf. I have the following
Code:
logging {
channel custom {
file "/tmp/named.log";
print-time yes; # timestamps
print-category yes;
};
category config { custom; };
category notify { custom; };
category dnssec { custom; };
category general { custom; };
category security { custom; };
category xfer-out { custom; }; # zone transfers
category lame-servers { custom; };
};
After starting the server, the following is reported:
[root@larsdell ~]# tail /var/log/messages
Apr 29 21:17:53 localhost named[12102]: no longer listening on 129.241.151.90#53
Apr 29 21:17:58 localhost named[12198]: starting BIND 9.2.5 -u named -t /var/named/chroot
Apr 29 21:17:58 localhost named[12198]: using 1 CPU
Apr 29 21:17:58 localhost named[12198]: loading configuration from '/etc/named.conf'
Apr 29 21:17:58 localhost named[12198]: listening on IPv4 interface lo, 127.0.0.1#53
Apr 29 21:17:58 localhost named[12198]: listening on IPv4 interface eth0, 129.241.151.90#53
Apr 29 21:17:58 localhost named[12198]: command channel listening on 127.0.0.1#953
Apr 29 21:17:58 localhost named[12198]: logging channel 'custom' file '/tmp/named.log': file not found
Apr 29 21:17:58 localhost named[12198]: isc_log_open '/tmp/named.log' failed: file not found
Apr 29 21:17:58 localhost named: named startup succeeded
I have created the file as shown:
[root@larsdell ~]# ls -l /tmp/named.log
-rwxr--r-- 1 named named 0 Apr 29 20:28 /tmp/named.log
The status of the service reports 'query logging is OFF'.
Does anyone have a suggestion?
Don't put it in /tmp, put it in /var/log/named, make sure /var/log/named is owned by the process that runs named.
I had the same problem with FC3, here is what I use:
logging {
channel "logfile" {
file "named.log" versions 5 size 5m;
print-time yes;
print-severity yes;
print-category yes;
};
category "default" { "logfile"; };
category "general" { "logfile"; };
category "update" { "logfile"; };
category "queries" { "logfile"; };
};
The log file ends up in /var/named/chroot/var/named due to the chroot.
I still haven't been able to get the dump-file and statistics-file working though.
This is strange. I use a mix of your suggestions in the logging section:
logging {
channel "logfile" {
file "/var/log/named/named.log" versions 5 size 5m;
print-time yes;
print-severity yes;
print-category yes;
};
category "default" { "logfile"; };
category "general" { "logfile"; };
category "update" { "logfile"; };
category "queries" { "logfile"; };
};
As Technoslave suggested, I created a directory like this
[root@larsdell named]# ls -al /var/log/named
total 16
drwxr-xr-x 2 named named 4096 Apr 30 16:46 .
A reboot followed by a 'service named stop' and 'service named start' three minutes later, resulted in the following:
[root@larsdell ~]# tail -n 500 /var/log/messages | grep named
Apr 30 17:19:35 localhost named[3393]: starting BIND 9.2.5 -u named -t /var/named/chroot
Apr 30 17:19:35 localhost named: named startup succeeded
Apr 30 17:22:14 localhost named: succeeded
Apr 30 17:22:22 localhost named[5137]: starting BIND 9.2.5 -u named -t /var/named/chroot
Apr 30 17:22:22 localhost named[5137]: using 1 CPU
Apr 30 17:22:22 localhost named[5137]: loading configuration from '/etc/named.conf'
Apr 30 17:22:22 localhost named[5137]: listening on IPv4 interface lo, 127.0.0.1#53
Apr 30 17:22:22 localhost named[5137]: listening on IPv4 interface eth0, 129.241.151.90#53
Apr 30 17:22:22 localhost named[5137]: command channel listening on 127.0.0.1#953
Apr 30 17:22:22 localhost named[5137]: logging channel 'logfile' file '/var/log/named/named.log': file
not found
Apr 30 17:22:22 localhost named[5137]: isc_log_open '/var/log/named/named.log' failed: file not found
Apr 30 17:22:22 localhost named: named startup succeeded
[root@larsdell ~]# ls -l /var/log/named/named.log
-rw-r--r-- 1 named named 0 Apr 30 17:11 /var/log/named/named.log
1. Can someone explain to me why these two different outcomes appears?
I think I've tried both, but anyway:
2. Should I 'touch', 'chown' and 'chmod' manually to create the file or will named create the file itself if necessary?
3. Just to be sure, the user 'named' is always running the process 'named', no matter which user is logged in?
The service named starts automatically in runlevel 5.
[root@larsdell named]# ps aux | grep named
named 16066 0.0 1.0 37752 2728 ? Ssl 16:46 0:00 /usr/sbin/named -u named -t /var/named/chroot
try specifying the log file like this:
Code:
file "named.log" versions 5 size 5m;
the error log is reporting "file not found" because the directory /var/named/chroot/var/log/named/ probably does not exist. Take a look at the chroot command.
[Quote]
Originally posted by Antonius_Block
the error log is reporting "file not found" because the directory /var/named/chroot/var/log/named/ probably does not exist.
[/Quote]
Thanks, no errors during start-up now.
原文出處: BIND - logging file not found