LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-26-2010, 02:39 PM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,677
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
BIND can't open its config file (via a symlink)


Got these messages in syslog:
Code:
Jan 26 15:24:58 marconi named[28544]: starting BIND 9.6.1-P2 -u bind
Jan 26 15:24:58 marconi named[28544]: built with '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/var' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-gnu-ld' '--with-dlz-postgres=no' '--with-dlz-mysql=no' '--with-dlz-bdb=yes' '--with-dlz-filesystem=yes' '--with-dlz-ldap=yes' '--with-dlz-stub=yes' '--with-geoip=/usr' '--enable-ipv6' 'CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS=' 'CXXFLAGS=-g -O2' 'FFLAGS=-g -O2'
Jan 26 15:24:58 marconi named[28544]: adjusted limit on open files from 1024 to 1048576
Jan 26 15:24:58 marconi named[28544]: found 4 CPUs, using 4 worker threads
Jan 26 15:24:58 marconi named[28544]: using up to 4096 sockets
Jan 26 15:24:58 marconi named[28544]: loading configuration from '/etc/bind/named.conf'
Jan 26 15:24:58 marconi named[28544]: none:0: open: /etc/bind/named.conf: permission denied
Jan 26 15:24:58 marconi named[28544]: loading configuration: permission denied
Jan 26 15:24:58 marconi named[28544]: exiting (due to fatal error)
However, the config file should be readable even by user bind:
Code:
drwxr-xr-x  21 root root  4096 Jan 15 15:12 /
drwxr-xr-x 103 root root  4096 Jan 26 15:16 /etc
drwxr-xr-x  21 root root  4096 Jan 15 15:12 /etc/..
drwxr-xr-x  18 root root  4096 Jan 26 15:14 /etc/../var
drwxr-xr-x   8 root root  4096 Jan 26 15:14 /etc/../var/bind
-rw-r--r--   1 root root 90472 Jan 26 15:14 /etc/../var/bind/named.conf
lrwxrwxrwx   1 root root    11 Jan 26 15:16 /etc/bind -> ../var/bind
drwxr-xr-x  18 root root  4096 Jan 26 15:14 /var
drwxr-xr-x   8 root root  4096 Jan 26 15:14 /var/bind
-rw-r--r--   1 root root 90472 Jan 26 15:14 /var/bind/named.conf
Yet it clearly fails, as shown by strace:
Code:
28549 15:24:58.954809 sendto(3, "<30>Jan 26 15:24:58 named[28544]: loading configuration from '/etc/bind/named.conf'", 83, MSG_NOSIGNAL, NULL, 0) = 83
28549 15:24:58.954940 open("/etc/bind/named.conf", O_RDONLY) = -1 EACCES (Permission denied)
28549 15:24:58.955059 sendto(3, "<27>Jan 26 15:24:58 named[28544]: none:0: open: /etc/bind/named.conf: permission denied", 87, MSG_NOSIGNAL, NULL, 0) = 87
This is BIND 9.6.1-P2 running on Ubuntu Server 9.10. Any idea what is going on? When I move all the files from /var/bind into /etc/bind (replacing the symlink that was at /etc/bind), and change all instances of "/var" to "/etc", then it works. It seems to be the symlink that is doing it. Yet I need to get this moved over to "/var" and the Ubuntu packagers built it to use "/etc/bind".

Also, when I su to user "bind" and run "md5sum /etc/bind/named.conf" (with the symlink in place) it is able to read it just fine. Other users can read it just find. It's the "/usr/sbin/named" program that can't.

Last edited by Skaperen; 01-26-2010 at 02:41 PM. Reason: added "also..."
 
Old 01-26-2010, 03:27 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,157
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Try to start it using:
Code:
named -u bind -c /var/bind/named.conf
and see if it works
 
Old 01-26-2010, 03:45 PM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,677

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Looks like the problem was in the "apparmor" program. That's a new one on me. And they didn't know "/var/bind" is a common place to put DNS, and assumed only "/var/cache/bind". It certainly didn't follow the principle of "least astonishment". Now I have to decide if I want to keep it and just tweak its configuration, or get rid of it and do things the legacy way. I will read and see if it's worth its trouble.
 
  


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
proftpd - Unable to open config file: /etc/security/pam_env.conf micxz Linux - Server 3 01-07-2010 08:59 AM
Bind problem: config files are missing after re-install bind 9.5 on Fedora Core 8 elvisious Linux - Software 1 07-15-2008 07:49 PM
how to open config file Lobo1628 Linux - Newbie 6 07-17-2006 10:58 AM
help please with bind zone file config smoalne Linux - Newbie 2 12-16-2004 10:56 PM
BIND DNS Problems with Zone file and Config Init-0 Linux - Networking 6 07-30-2003 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:34 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
Open Source Consulting | Domain Registration