bind9 fails to create pid file.

Bug #729780 reported by Anand Kumria
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bind9 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: bind9

1.

root@ns3:~# lsb_release -rd
Description: Ubuntu 10.04.2 LTS
Release: 10.04

2.

ot@ns3:~# apt-cache policy bind9
bind9:
  Installed: 1:9.7.0.dfsg.P1-1ubuntu0.1
  Candidate: 1:9.7.0.dfsg.P1-1ubuntu0.1
  Version table:
 *** 1:9.7.0.dfsg.P1-1ubuntu0.1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
        500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
        100 /var/lib/dpkg/status
     1:9.7.0.dfsg.P1-1 0
        500 http://ubuntu.positive-internet.com/ubuntu/ lucid/main Packages
        500 http://gb.archive.ubuntu.com/ubuntu/ lucid/main Packages

3.

I expected bind to create a pid file.

4.

bind9 did not create a pid file.

Here are the default when installing from scratch, and 'apt-get install bind9'.

root@ns3:~# ps aux | grep bind
root 4138 0.0 0.2 6156 736 pts/0 S+ 18:27 0:00 grep bind
root@ns3:~# ls -l /var/run/
total 44
drwxr-xr-x 2 root root 60 Mar 5 14:50 ConsoleKit
-rw-r--r-- 1 root root 4 Mar 4 06:36 collectdmon.pid
-rw-r--r-- 1 root root 5 Mar 4 06:37 console-kit-daemon.pid
-rw-r--r-- 1 root root 4 Mar 4 06:36 crond.pid
---------- 1 root root 0 Mar 4 06:36 crond.reboot
drwxr-xr-x 2 messagebus messagebus 80 Mar 4 06:36 dbus
drwxr-xr-x 2 root root 80 Mar 4 06:36 fail2ban
-rw-r--r-- 1 root root 3 Mar 4 06:36 memcached.pid
-rw-r--r-- 1 root root 187 Mar 5 14:50 motd
drwxrwxr-x 2 root bind 40 Nov 30 20:35 named

running bind9 results in:

Mar 5 18:27:47 ns3 named[4154]: starting BIND 9.7.0-P1 -u bind
Mar 5 18:27:47 ns3 named[4154]: built with '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/var' '--en
able-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=-fn
o-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS='
Mar 5 18:27:47 ns3 named[4154]: adjusted limit on open files from 1024 to 1048576
Mar 5 18:27:47 ns3 named[4154]: found 1 CPU, using 1 worker thread
Mar 5 18:27:47 ns3 named[4154]: using up to 4096 sockets
Mar 5 18:27:47 ns3 named[4154]: loading configuration from '/etc/bind/named.conf'
Mar 5 18:27:47 ns3 named[4154]: reading built-in trusted keys from file '/etc/bind/bind.keys'
Mar 5 18:27:47 ns3 named[4154]: using default UDP/IPv4 port range: [1024, 65535]
Mar 5 18:27:47 ns3 named[4154]: using default UDP/IPv6 port range: [1024, 65535]
Mar 5 18:27:47 ns3 named[4154]: listening on IPv6 interfaces, port 53
Mar 5 18:27:47 ns3 named[4154]: listening on IPv4 interface lo, 127.0.0.1#53
Mar 5 18:27:47 ns3 named[4154]: listening on IPv4 interface eth0, 95.172.29.74#53
Mar 5 18:27:47 ns3 named[4154]: Could not open '/var/run/named/named.pid'.
Mar 5 18:27:47 ns3 named[4154]: Please check file and directory permissions or reconfigure the filename.
Mar 5 18:27:47 ns3 named[4154]: could not open file '/var/run/named/named.pid': Permission denied
Mar 5 18:27:47 ns3 named[4154]: generating session key for dynamic DNS
Mar 5 18:27:47 ns3 named[4154]: Could not open '/var/run/named/session.key'.
Mar 5 18:27:47 ns3 named[4154]: Please check file and directory permissions or reconfigure the filename.
Mar 5 18:27:47 ns3 named[4154]: could not open file '/var/run/named/session.key': Permission denied
Mar 5 18:27:47 ns3 named[4154]: could not create /var/run/named/session.key
Mar 5 18:27:47 ns3 named[4154]: failed to generate session key for dynamic DNS: permission denied
Mar 5 18:27:47 ns3 named[4154]: automatic empty zone: 254.169.IN-ADDR.ARPA

root@ns3:~# ps aux | grep bind
bind 4154 0.1 5.1 119468 12864 ? Ssl 18:27 0:00 /usr/sbin/named -u bind
root 4169 0.0 0.2 6156 740 pts/0 S+ 18:28 0:00 grep bind

OK - so it is running as the user bind.

Let's chown the directory to that user:

root@ns3:~# chown bind: /var/run/named/
root@ns3:~# ls -la /var/run/
total 48
drwxr-xr-x 11 root root 440 Mar 5 14:50 .
drwxr-xr-x 15 root root 4096 Mar 4 05:21 ..
drwxr-xr-x 2 root root 60 Mar 5 14:50 ConsoleKit
-rw-r--r-- 1 root root 4 Mar 4 06:36 collectdmon.pid
-rw-r--r-- 1 root root 5 Mar 4 06:37 console-kit-daemon.pid
-rw-r--r-- 1 root root 4 Mar 4 06:36 crond.pid
---------- 1 root root 0 Mar 4 06:36 crond.reboot
drwxr-xr-x 2 messagebus messagebus 80 Mar 4 06:36 dbus
drwxr-xr-x 2 root root 80 Mar 4 06:36 fail2ban
-rw-r--r-- 1 root root 3 Mar 4 06:36 memcached.pid
-rw-r--r-- 1 root root 187 Mar 5 14:50 motd
drwxrwxr-x 2 bind netdev 40 Nov 30 20:35 named

Notice that the group has changed to netdev.

Unfortuately, this does not fix the problem either:

Mar 5 18:29:08 ns3 named[4186]: starting BIND 9.7.0-P1 -u bind
Mar 5 18:29:08 ns3 named[4186]: built with '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/var' '--en
able-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=-fn
o-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS='
Mar 5 18:29:08 ns3 named[4186]: adjusted limit on open files from 1024 to 1048576
Mar 5 18:29:08 ns3 named[4186]: found 1 CPU, using 1 worker thread
Mar 5 18:29:08 ns3 named[4186]: using up to 4096 sockets
Mar 5 18:29:08 ns3 named[4186]: loading configuration from '/etc/bind/named.conf'
Mar 5 18:29:08 ns3 named[4186]: reading built-in trusted keys from file '/etc/bind/bind.keys'
Mar 5 18:29:08 ns3 named[4186]: using default UDP/IPv4 port range: [1024, 65535]
Mar 5 18:29:08 ns3 named[4186]: using default UDP/IPv6 port range: [1024, 65535]
Mar 5 18:29:08 ns3 named[4186]: listening on IPv6 interfaces, port 53
Mar 5 18:29:08 ns3 named[4186]: binding TCP socket: address in use
Mar 5 18:29:08 ns3 named[4186]: listening on IPv4 interface lo, 127.0.0.1#53
Mar 5 18:29:08 ns3 named[4186]: binding TCP socket: address in use
Mar 5 18:29:08 ns3 named[4186]: listening on IPv4 interface eth0, 95.172.29.74#53
Mar 5 18:29:08 ns3 named[4186]: binding TCP socket: address in use
Mar 5 18:29:08 ns3 named[4186]: Could not open '/var/run/named/named.pid'.
Mar 5 18:29:08 ns3 named[4186]: Please check file and directory permissions or reconfigure the filename.
Mar 5 18:29:08 ns3 named[4186]: could not open file '/var/run/named/named.pid': Permission denied
Mar 5 18:29:08 ns3 named[4186]: generating session key for dynamic DNS
Mar 5 18:29:08 ns3 named[4186]: Could not open '/var/run/named/session.key'.
Mar 5 18:29:08 ns3 named[4186]: Please check file and directory permissions or reconfigure the filename.
Mar 5 18:29:08 ns3 named[4186]: could not open file '/var/run/named/session.key': Permission denied
Mar 5 18:29:08 ns3 named[4186]: could not create /var/run/named/session.key
Mar 5 18:29:08 ns3 named[4186]: failed to generate session key for dynamic DNS: permission denied
Mar 5 18:29:08 ns3 named[4186]: automatic empty zone: 254.169.IN-ADDR.ARPA

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi there,

Thank you for taking the time to report bugs and trying to make Ubuntu better. Could you please provide the following information?

 - Sample configuration files
 - Could you please provide and step-by-step to be able to reproduce this bug report?
 - Have you installed bind9 first,t hen made configuration/permission changes after which you saw this error?

I've tried to reproduce this bug and I've been unsuccessful. What I did is the following in a fresh Ubuntu install:

sudo apt-get install bind9

Mar 8 15:31:20 ubuntu named[2412]: starting BIND 9.7.0-P1 -u bind
Mar 8 15:31:20 ubuntu named[2412]: 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='
Mar 8 15:31:20 ubuntu named[2412]: adjusted limit on open files from 1024 to 1048576
Mar 8 15:31:20 ubuntu named[2412]: found 2 CPUs, using 2 worker threads
Mar 8 15:31:20 ubuntu named[2412]: using up to 4096 sockets
Mar 8 15:31:20 ubuntu named[2412]: loading configuration from '/etc/bind/named.conf'
Mar 8 15:31:20 ubuntu named[2412]: reading built-in trusted keys from file '/etc/bind/bind.keys'
Mar 8 15:31:20 ubuntu named[2412]: using default UDP/IPv4 port range: [1024, 65535]
Mar 8 15:31:20 ubuntu named[2412]: using default UDP/IPv6 port range: [1024, 65535]
Mar 8 15:31:20 ubuntu named[2412]: listening on IPv6 interfaces, port 53
Mar 8 15:31:20 ubuntu named[2412]: listening on IPv4 interface lo, 127.0.0.1#53
Mar 8 15:31:20 ubuntu named[2412]: listening on IPv4 interface eth0, 192.168.122.138#53
Mar 8 15:31:20 ubuntu named[2412]: generating session key for dynamic DNS
Mar 8 15:31:20 ubuntu named[2412]: automatic empty zone: 254.169.IN-ADDR.ARPA
Mar 8 15:31:20 ubuntu named[2412]: automatic empty zone: 2.0.192.IN-ADDR.ARPA
Mar 8 15:31:20 ubuntu named[2412]: automatic empty zone: 255.255.255.255.IN-ADDR.ARPA

Note the permissions are not the ones you mention. Additionally, files under /var/run are whipped out whenever the machine boots up and each service creates new files after the boot up process. The wrong permissions/ownership you have seen might be from a wrong configuration file.

ubuntu@ubuntu:~/debian$ ls -l /var/run/named/
total 8
-rw-r--r-- 1 bind bind 5 2011-03-08 15:31 named.pid
-rw------- 1 bind bind 102 2011-03-08 15:31 session.key

ubuntu@ubuntu:~/debian$ ls -l /var/run/
total 36
[..]
drwxrwxr-x 2 root bind 80 2011-03-08 15:31 named
[..]

I'm marking this bug report as incomplete until further information is provided.

Changed in bind9 (Ubuntu):
status: New → Incomplete
Revision history for this message
Chuck Short (zulcss) wrote :

We'd like to figure out what's causing this bug for you, but we haven't heard back from you in a while. Could you please provide the requested information? Thanks!

Revision history for this message
sefs (sefsinc) wrote :

I just upgraded from 8.04.2 to 10.04.2, and when I look into /var/run I see no named.pid file. BUT bind is happily running. How can we solve this bug.

Thanks.

Revision history for this message
sefs (sefsinc) wrote :

Ok, I found it in /var/run/named/named.pid.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for bind9 (Ubuntu) because there has been no activity for 60 days.]

Changed in bind9 (Ubuntu):
status: Incomplete → Expired
Revision history for this message
myf5 (b-web-z) wrote :
Download full text (8.7 KiB)

Seem like I am facing the bug, here are my configurations and permission of the directories:

====logs====
Jul 31 04:35:33 bind named[5139]: received control channel command 'stop -p'
Jul 31 04:35:33 bind named[5139]: shutting down: flushing changes
Jul 31 04:35:33 bind named[5139]: stopping command channel on 127.0.0.1#953
Jul 31 04:35:33 bind named[5139]: stopping command channel on ::1#953
Jul 31 04:35:33 bind named[5139]: no longer listening on 127.0.0.1#53
Jul 31 04:35:33 bind named[5139]: no longer listening on 192.168.0.103#53
Jul 31 04:35:33 bind named[5139]: exiting
Jul 31 04:35:33 bind named[5177]: starting BIND 9.8.0-P2 -u bind
Jul 31 04:35:33 bind named[5177]: built with '--prefix=/usr' '--with-openssl=yes' '--sysconfdir=/etc/bind' '--with-randomdev=/dev/urandom'
Jul 31 04:35:33 bind named[5177]: using up to 4096 sockets
Jul 31 04:35:33 bind named[5177]: loading configuration from '/etc/bind/named.conf'
Jul 31 04:35:33 bind named[5177]: reading built-in trusted keys from file '/etc/bind/bind.keys'
Jul 31 04:35:33 bind named[5177]: using default UDP/IPv4 port range: [1024, 65535]
Jul 31 04:35:33 bind named[5177]: using default UDP/IPv6 port range: [1024, 65535]
Jul 31 04:35:33 bind named[5177]: listening on IPv4 interface lo, 127.0.0.1#53
Jul 31 04:35:33 bind named[5177]: listening on IPv4 interface eth4, 192.168.0.103#53
Jul 31 04:35:33 bind named[5177]: binding TCP socket: address in use
Jul 31 04:35:33 bind named[5177]: Could not open '/usr/var/run/named/named.pid'.
Jul 31 04:35:33 bind named[5177]: Please check file and directory permissions or reconfigure the filename.
Jul 31 04:35:33 bind named[5177]: could not open file '/usr/var/run/named/named.pid': Permission denied
Jul 31 04:35:33 bind named[5177]: generating session key for dynamic DNS
Jul 31 04:35:33 bind named[5177]: Could not open '/usr/var/run/named/session.key'.
Jul 31 04:35:33 bind named[5177]: Please check file and directory permissions or reconfigure the filename.
Jul 31 04:35:33 bind named[5177]: could not open file '/usr/var/run/named/session.key': Permission denied
Jul 31 04:35:33 bind named[5177]: could not create /usr/var/run/named/session.key
Jul 31 04:35:33 bind named[5177]: failed to generate session key for dynamic DNS: permission denied
Jul 31 04:35:33 bind named[5177]: set up managed keys zone for view _default, file 'managed-keys.bind'
Jul 31 04:35:33 bind named[5177]: command channel listening on 127.0.0.1#953
Jul 31 04:35:33 bind named[5177]: command channel listening on ::1#953
Jul 31 04:35:33 bind named[5177]: zone 0.in-addr.arpa/IN: loaded serial 1
Jul 31 04:35:33 bind named[5177]: zone 127.in-addr.arpa/IN: loaded serial 1
Jul 31 04:35:33 bind named[5177]: zone 255.in-addr.arpa/IN: loaded serial 1
Jul 31 04:35:33 bind named[5177]: zone localhost/IN: loaded serial 2
Jul 31 04:35:33 bind named[5177]: zone cnadn.net/IN: loaded serial 2011091804
Jul 31 04:35:33 bind named[5177]: zone sub.cnadn.net/IN: loaded serial 2011062601
Jul 31 04:35:33 bind named[5177]: managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found
Jul 31 04:35:33 bind named[5177]: managed-keys-zone ./IN: loaded serial 0
Jul 31 04:35:33 bind named[51...

Read more...

Revision history for this message
myf5 (b-web-z) wrote :

Forgot system version and bind version:
bind.dnssec.ubuntu 2.6.24-19-server #1 SMP Wed Jun 18 15:18:00 UTC 2008 i686 GNU/Linux
root@bind:/var/cache/bind# named -v
BIND 9.8.0-P2

Jymbob (james-scholes)
Changed in bind9 (Ubuntu):
status: Expired → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for bind9 (Ubuntu) because there has been no activity for 60 days.]

Changed in bind9 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.