bind9 fails to create pid file.
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.
Candidate: 1:9.7.0.
Version table:
*** 1:9.7.0.
500 http://
500 http://
100 /var/lib/
1:
500 http://
500 http://
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-
-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=
able-threads' '--enable-
=no' '--with-
o-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=
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/
Mar 5 18:27:47 ns3 named[4154]: reading built-in trusted keys from file '/etc/bind/
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/
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/
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/
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/
Mar 5 18:27:47 ns3 named[4154]: could not create /var/run/
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.
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-
-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=
able-threads' '--enable-
=no' '--with-
o-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=
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/
Mar 5 18:29:08 ns3 named[4186]: reading built-in trusted keys from file '/etc/bind/
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/
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/
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/
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/
Mar 5 18:29:08 ns3 named[4186]: could not create /var/run/
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.
Changed in bind9 (Ubuntu): | |
status: | Expired → Incomplete |
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 permission changes after which you saw this error?
- 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/
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 /usr/share/ man' '--infodir= /usr/share/ info' '--sysconfdir= /etc/bind' '--localstatedi r=/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=' named.conf' bind.keys' IN-ADDR. ARPA IN-ADDR. ARPA 255.255. IN-ADDR. ARPA
Mar 8 15:31:20 ubuntu named[2412]: built with '--prefix=/usr' '--mandir=
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/
Mar 8 15:31:20 ubuntu named[2412]: reading built-in trusted keys from file '/etc/bind/
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.
Mar 8 15:31:20 ubuntu named[2412]: automatic empty zone: 2.0.192.
Mar 8 15:31:20 ubuntu named[2412]: automatic empty zone: 255.255.
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.