LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-29-2005, 02:38 PM   #1
buskmann
LQ Newbie
 
Registered: Mar 2005
Location: Norway
Distribution: FC5
Posts: 27

Rep: Reputation: 16
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?
 
Old 04-29-2005, 03:00 PM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
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.
 
Old 04-29-2005, 03:30 PM   #3
Antonius_Block
LQ Newbie
 
Registered: Nov 2004
Location: D.C.
Distribution: FC3,4
Posts: 11

Rep: Reputation: 1
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.
 
Old 04-30-2005, 10:37 AM   #4
buskmann
LQ Newbie
 
Registered: Mar 2005
Location: Norway
Distribution: FC5
Posts: 27

Original Poster
Rep: Reputation: 16
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

Last edited by buskmann; 04-30-2005 at 10:50 AM.
 
Old 04-30-2005, 01:50 PM   #5
Antonius_Block
LQ Newbie
 
Registered: Nov 2004
Location: D.C.
Distribution: FC3,4
Posts: 11

Rep: Reputation: 1
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.
 
1 members found this post helpful.
Old 05-02-2005, 11:33 AM   #6
buskmann
LQ Newbie
 
Registered: Mar 2005
Location: Norway
Distribution: FC5
Posts: 27

Original Poster
Rep: Reputation: 16
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.
 
1 members found this post helpful.
Old 01-25-2024, 12:54 AM   #7
mdmathin
LQ Newbie
 
Registered: Jan 2024
Posts: 1

Rep: Reputation: 0
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; };
};

Last edited by mdmathin; 01-25-2024 at 12:58 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
howto enable logging from BIND 9 on Debian Sarge ? cccc Debian 2 07-07-2005 06:43 PM
File Access Logging dman65 Linux - General 3 04-08-2005 01:12 PM
keystroke logging to file? musicman_ace Linux - Software 3 12-12-2004 06:49 AM
BIND - logging issues thebee Linux - Software 0 06-23-2003 12:20 PM
Help with Logging to a file jester_69 Linux - General 3 06-21-2002 08:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration