Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question is a bit similar to this one but the answer that seemed to help the most is Ubuntu specific, and this is running on OSX 10.6.8.

With this logging clause:

logging {
         category default {
                 _default_log;
         };

         channel _default_log  {
                 file "/var/chroot/named/var/log/query.log";
                 severity info;
                 print-time yes;
         };
 };

I get this error in the system.log:

isc_log_open '/var/chroot/named/var/log/query.log' failed: file not found

This article on bind9's logging clause in the conf file says:

file 'path_name' is a quoted string defining the absolute path to the logging file e.g. "/var/log/named/namedlog.log".

But the conf is inside the jail at /var/chroot/named/etc/named.conf and I'd like the log to be written to either /var/chroot/named/var/log/query.log, which is inside the jail, or /Library/Logs/named.log which is outside the jail (and is where the log was pointing to before the chrooting). Whichever I can get to work is fine.

Any help is much appreciated!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Since your bind is running inside a jail chroot, your path should be relative to it.

For your chrooted bind, the / directory starts at /var/chroot/named, being so you should change the filename to /var/log/query.log and make sure bind has permission to write into /var/log.

Also, you may have your logs written on both files. If the above change work out, you may link the two files (/var/chroot/named/var/log/query.log and /Library/Logs/named.log) into one using, outside the chroot, the command:

$ ln /var/chroot/named/var/log/query.log /Library/Logs/named.log

Doing so will give you the same content at both locations. But, be warned that removing one file won't remove the other, but emptying it, will do it for both. So, if you use logrotate, or similar program, you will need to rotate both files and make sure the link is recreated every time.

share|improve this answer
    
Thanks for the help, much appreciated. –  Iain Jan 13 '13 at 16:57

Change the filename in the directive to /var/log/query.log.....You are on a chroot'd area which has /var/chroot/named as its root.

share|improve this answer
    
fboaventura gave a little bit more info so I gave that answer the tick, but I really appreciate the help, thanks. –  Iain Jan 13 '13 at 16:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.