named fail to start (jail) and dhcpd have very strange behaviour .

First
Just for information in case if it is important to start dhcpd and named :
Sep 16 20:26:44 LINUX-SRV named[2417]: nss_ldap: could not search LDAP server - Server is unavailable
Sep 16 20:26:44 LINUX-SRV named[2417]: nss_ldap: could not search LDAP server - Server is unavailable

Secondly
Both config files in /etc/sysconfig set parameters to start in jail root
but
NAMED_CONF_INCLUDE_FILES=""
DHCPD_CONF_INCLUDE_FILES=""

1°) DHCPD
================
To make dhcpd to start :
named.keys must be in both directory :
"/etc/named.keys"
"/var/lib/dhcp/etc/named.keys"

and
/etc/dhcpd.conf must contain :
include “/etc/named.keys”;

( not → include “/var/lib/dhcp/etc/named.keys”; because in that case it does not find the named.keys file : Can’t open /var/lib/dhcp/etc/named.keys: No such file or directory )

LINUX-SRV:~ # service dhcpd start
Starting ISC DHCPv4 4.x Server [chroot] done
LINUX-SRV:~ #

**2°) NAMED **
================

with : /etc/named.conf file :

Include file with key

#################################################
include “/etc/named.keys”;
include “/etc/named.conf.include”; ( this file is empty )

/var/log/messages :

Sep 16 20:26:44 LINUX-SRV named[2418]: starting BIND 9.7.1 -t /var/lib/named -u named
Sep 16 20:26:44 LINUX-SRV named[2418]: built with ‘–prefix=/usr’ ‘–bindir=/usr/bin’ ‘–sbindir=/usr/sbin’ ‘–sysconfdir=/etc’ ‘–localstatedir=/var’ ‘–libdir=/usr/lib’ ‘–includedir=/usr/include/bind’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–with-openssl’ ‘–enable-threads’ ‘–with-libtool’ ‘–enable-runidn’ ‘–with-libxml2’ ‘–with-dlz-mysql’ ‘–with-dlz-ldap’ ‘CFLAGS=-fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing’ ‘LDFLAGS=-L/usr/lib’
Sep 16 20:26:44 LINUX-SRV named[2418]: adjusted limit on open files from 8192 to 1048576
Sep 16 20:26:44 LINUX-SRV named[2418]: found 1 CPU, using 1 worker thread
Sep 16 20:26:44 LINUX-SRV named[2418]: using up to 4096 sockets
Sep 16 20:26:44 LINUX-SRV named[2418]: loading configuration from ‘/etc/named.conf’
Sep 16 20:26:44 LINUX-SRV named[2418]: /etc/named.conf:212: open: /etc/named.keys: permission denied
Sep 16 20:26:44 LINUX-SRV named[2418]: loading configuration: permission denied
Sep 16 20:26:44 LINUX-SRV named[2418]: exiting (due to fatal error)

with : /etc/named.conf file :

Include file with key

#################################################
include “/var/lib/named/etc/named.keys”;
include “/etc/named.conf.include”; ( this file is empty )

/var/log/messages :

Sep 16 21:11:35 LINUX-SRV named[6065]: starting BIND 9.7.1 -t /var/lib/named -u named
Sep 16 21:11:35 LINUX-SRV named[6065]: built with ‘–prefix=/usr’ ‘–bindir=/usr/bin’ ‘–sbindir=/usr/sbin’ ‘–sysconfdir=/etc’ ‘–localstatedir=/var’ ‘–libdir=/usr/lib’ ‘–includedir=/usr/include/bind’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–with-openssl’ ‘–enable-threads’ ‘–with-libtool’ ‘–enable-runidn’ ‘–with-libxml2’ ‘–with-dlz-mysql’ ‘–with-dlz-ldap’ ‘CFLAGS=-fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing’ ‘LDFLAGS=-L/usr/lib’
Sep 16 21:11:35 LINUX-SRV named[6065]: adjusted limit on open files from 8192 to 1048576
Sep 16 21:11:35 LINUX-SRV named[6065]: found 1 CPU, using 1 worker thread
Sep 16 21:11:35 LINUX-SRV named[6065]: using up to 4096 sockets
Sep 16 21:11:35 LINUX-SRV named[6065]: loading configuration from ‘/etc/named.conf’
Sep 16 21:11:35 LINUX-SRV named[6065]: /etc/named.conf:212: open: /var/lib/named/etc/named.keys: file not found
Sep 16 21:11:35 LINUX-SRV named[6065]: loading configuration: file not found
Sep 16 21:11:35 LINUX-SRV named[6065]: exiting (due to fatal error)

During starting, the daemon destroy “/var/lib/named/etc/named.keys”

For the moment, I want just to start named and dhcpd.

I am following this howto :
Tutorial : Samba PDC + OpenLDAP on openSUSE 11.1

Thank you for your help.

Digging further

1°) necessary files are copied from /etc to /var/lib/dhcp/etc

2°) from /var/lib/dhcp/etc/dhcpd.conf

test 1 : include “/var/lib/dhcp/etc/rndc.key”;
dhcpd does no start -> Can’t open /var/lib/dhcp/etc/rndc.key: No such file or directory

test 2 : include “/etc/rndc.key”;
dhcpd start -> Starting ISC DHCPv4 4.x Server [chroot] done

test 3 : key “uuuu-key” {
algorithm hmac-md5;
secret “abcdefghijkllmnopqrstuvwxyz==”;
};
dhcpd start -> Starting ISC DHCPv4 4.x Server [chroot] done

rndc.key owner : root:named perm : 640

It seems that dhcpd cannot read the keyfile /var/lib/dhcp/etc/rndc.key

Digging further

1°) necessary files are copied from /etc to /var/lib/named/etc

2°) from /var/lib/named/etc/named.conf

test 1 : include “/var/lib/named/etc/rndc.key”;
named start with error -> Starting name server BIND cp: cannot stat `/var/lib/named/etc/rndc.key’: No such file or directory done

test 2 : include “/etc/rndc.key”;
named start -> Starting name server BIND done

test 3 : key “uuuu-key” {
algorithm hmac-md5;
secret “abcdefghijkllmnopqrstuvwxyz==”;
};
named start -> Starting name server BIND done

rndc.key owner : root:named perm : 640

It seems that named cannot read the keyfile /var/lib/named/etc/rndc.key