LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-23-2011, 01:14 AM   #16
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,601

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532

Quote:
[root@prueba ~]# ps -ef|grep named

root 3171 3056 0 19:02 pts/0 00:00:00 grep named
The ps output means that named is not running. Try to start the service and run ps again.

Quote:
I changed the named.conf with the lines that you said. It's working now but not writting the log.
Are you sure it's working?
Because from above looks like named is not running. If you have created the logfile yourself, delete it and let named create its own when it starts.

Regards
 
Old 08-23-2011, 10:38 AM   #17
Nocta
LQ Newbie
 
Registered: Aug 2011
Location: Buenos Aires, Argentina
Distribution: CentOS
Posts: 14

Original Poster
Rep: Reputation: Disabled
Sorry, you're right.

Quote:
[root@prueba ~]# ps -ef|grep named
named 1946 1 3 11:34 ? 00:00:00 /usr/sbin/named -u named
root 1955 1914 0 11:35 pts/0 00:00:00 grep named
 
Old 08-23-2011, 12:12 PM   #18
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,601

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
So, what is the situation now? Does is write in the log file?
If it doesn't change severity to debug
Code:
severity debug 3;
to see what happens

Regards
 
Old 08-23-2011, 01:29 PM   #19
Nocta
LQ Newbie
 
Registered: Aug 2011
Location: Buenos Aires, Argentina
Distribution: CentOS
Posts: 14

Original Poster
Rep: Reputation: Disabled
Nope, the same :/

Quote:
Aug 23 14:27:47 localhost named[2131]: /etc/named.conf:233: couldn't add command channel 192.168.0.6#3333: permission denied
Aug 23 14:27:47 localhost named[2131]: the working directory is not writable
Aug 23 14:27:47 localhost named[2131]: logging channel 'bindlog' file '/var/named/dnsserver.log': permission denied
Aug 23 14:27:47 localhost named[2131]: isc_log_open '/var/named/dnsserver.log' failed: permission denie
It's not writing in the log file.

Thanks for the patience.
 
Old 08-23-2011, 01:56 PM   #20
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,601

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
What is the output of:
Code:
ls -ld /var/named
ls -l /var/named
If the directory owner is not the user named, you need to change it:
Code:
chown -R named:named /var/named
 
Old 08-23-2011, 02:32 PM   #21
Nocta
LQ Newbie
 
Registered: Aug 2011
Location: Buenos Aires, Argentina
Distribution: CentOS
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
[root@prueba ~]# chown -R named:named /var/named

[root@prueba ~]# ls -ld /var/named

drwxr-x---. 5 named named 4096 ago 21 13:55 /var/named

[root@prueba ~]# ls -l /var/named

Átotal 52

drwxrwx---. 2 named named 4096 ago 21 15:07 data

drwxrwx---. 2 named named 4096 ago 23 14:27 dynamic

-rw-r--r--. 1 named named 56 ago 20 21:45 my.external.zone.db

-rw-r--r--. 1 named named 56 ago 20 21:45 my.internal.zone.db

-rw-r-----. 1 named named 1892 ago 20 21:45 named.ca

-rw-r-----. 1 named named 152 ago 20 21:45 named.empty

-rw-r-----. 1 named named 152 ago 20 21:45 named.localhost

-rw-r-----. 1 named named 168 ago 20 21:45 named.loopback

-rw-r--r--. 1 named named 176 ago 20 22:12 prueba1.ec.zone

-rw-r-----. 1 named named 180 ago 21 13:55 prueba.ec.zone

-rw-r-----. 1 named named 176 ago 20 21:56 prueba.ec.zone~

-rw-rw-r--. 1 named named 599 ago 20 19:41 rndc.conf

drwxrwx---. 2 named named 4096 ago 20 21:45 slaves
I'll edit this message after a couple of minutes. Just to check if it's writing or not in the log file.

EDIT: I don't read any error at /var/log/messages but there's not dnsserver.log file in /var/named/

Last edited by Nocta; 08-23-2011 at 02:47 PM.
 
Old 08-23-2011, 04:44 PM   #22
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,601

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
Did you restart named after changing permissions?
 
Old 08-23-2011, 04:55 PM   #23
Nocta
LQ Newbie
 
Registered: Aug 2011
Location: Buenos Aires, Argentina
Distribution: CentOS
Posts: 14

Original Poster
Rep: Reputation: Disabled
Of course.

So far I don't see any errors at /var/log/messages but there's no dnsserver.log file.

Maybe I have to wait until logfile is 5mb?

EDIT: I have just checked /var/log/messages and guess what:

Quote:
Aug 23 17:55:30 localhost named[4200]: /etc/named.conf:233: couldn't add command channel 192.168.0.6#3333: permission denied
Aug 23 17:55:30 localhost named[4200]: the working directory is not writable
Aug 23 17:55:30 localhost named[4200]: logging channel 'bindlog' file '/var/named/dnsserver.log': permission denied
Aug 23 17:55:30 localhost named[4200]: isc_log_open '/var/named/dnsserver.log' failed: permission denied

Last edited by Nocta; 08-23-2011 at 05:04 PM.
 
Old 08-23-2011, 05:08 PM   #24
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,601

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
No, 5mb means that the logfile will be rotated when it reaches that size.

I still think it's selinux. Try to disable it temporarily by running
Code:
setenforce 0
restart named and see what happens
 
1 members found this post helpful.
Old 08-23-2011, 10:51 PM   #25
Nocta
LQ Newbie
 
Registered: Aug 2011
Location: Buenos Aires, Argentina
Distribution: CentOS
Posts: 14

Original Poster
Rep: Reputation: Disabled
You rock man!

It's working now!.

Do I have to type that command everytime I power on my CentOS Virtual Machine?

Thanks!
 
Old 08-23-2011, 10:58 PM   #26
LBM
Member
 
Registered: Aug 2010
Location: Denmark
Distribution: Debian
Posts: 88

Rep: Reputation: 0
If SELinux is the cause of the problem, you could disable it permanently.
http://www.centos.org/docs/5/html/5....e-disable.html

Another solution, is to make it work together with SELinux.
 
Old 08-24-2011, 01:28 AM   #27
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,601

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
I've told you since the beginning that it was a selinux problem.
Anyway as the previous poster above said, you should either disable selinux completely, or fix the context of the logfile.
I'm not familiar with selinux, but according to this, I guess you need something like
Code:
chcon -t named_cache_t /var/named/dnsserver.log

Regards
 
Old 08-24-2011, 09:47 AM   #28
Nocta
LQ Newbie
 
Registered: Aug 2011
Location: Buenos Aires, Argentina
Distribution: CentOS
Posts: 14

Original Poster
Rep: Reputation: Disabled
Yes, that's what I did yesterday.

So far it's working.

Thanks guys for your help and patience!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Problem in bind. (centos 5.6) takayama Linux - Networking 1 08-13-2011 12:17 PM
bind not working in centos baronobeefdip Linux - Server 4 07-30-2011 04:35 AM
Install bind 9.7 in centos anishkumarv Linux - Newbie 3 07-15-2011 07:49 AM
Bind 9.3.4 and Centos GGlinux Linux - Newbie 2 01-18-2009 08:57 PM
CentOS 5.1 Bind config ratcateme Linux - Software 1 02-01-2008 11:06 PM


All times are GMT -5. The time now is 11:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration