LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   BIND - logging file not found (https://www.linuxquestions.org/questions/linux-networking-3/bind-logging-file-not-found-318501/)

buskmann 04-29-2005 02:38 PM

BIND - logging file not found
 
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?

Technoslave 04-29-2005 03:00 PM

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.

Antonius_Block 04-29-2005 03:30 PM

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.

buskmann 04-30-2005 10:37 AM

This is strange. I use a mix of your suggestions in the logging section:
Code:

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
Code:

[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:
Code:

[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.
Code:

[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


Antonius_Block 04-30-2005 01:50 PM

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.

buskmann 05-02-2005 11:33 AM

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.
Thanks, no errors during start-up now.

mdmathin 01-25-2024 12:54 AM

bind9 query log path change
 
I am able to write query.log under /var/named/chroot/var/named. The below is my configuration file which is working perfectly.

logging {
channel query {
file "/var/log/bind/query.log";
print-time yes;
severity info;
};
category queries { query; };
};

Additional Info i have disabled the apparmor.service

I want to change the path to write the query example of path is /home/user1/query.log Facing the error isc_stdio_open '/home/user1/query.log' failed: file not found. Tried by changing the file permission and ownership but no luck

logging {
channel query {
file "/home/user1/query.log";
print-time yes;
severity info;
};
category queries { query; };
};


All times are GMT -5. The time now is 03:55 AM.