Hello, I'm unable to start bind 9.11.3 on FreeBSD 10.4-RELEASE-p9 amd64. It is builded with default configuration options. Steps to reproduce: # portmaster dns/bind911 # mkdir -p /var/named/usr/local/etc # cd /usr/local/etc/ && mv mv namedb /var/named/usr/local/etc/ # ln -s /var/named/usr/local/etc/namedb # sysrc altlog_proglist+=named # printf 'named_enable="YES"\nnamed_chrootdir="/var/named/"\n' >>/etc/rc.conf add "allow-new-zones true;" into options section of /var/named/usr/local/etc/namedb/named.conf # /usr/local/etc/rc.d/named start Result: Starting named. /usr/local/etc/rc.d/named: WARNING: failed to start named Content of /var/log/messages: mdb_env_open of '_default.nzd' failed: No such file or directory loading configuration: failure exiting (due to fatal error) Anyway, bind creates file _default.nzd-lock in directory /var/named/usr/local/etc/namedb/working # ls -l /var/named/usr/local/etc/namedb/working/ total 8 -rw------- 1 root wheel 8192 18 jún 21:27 _default.nzd-lock bind has full access to his working directory # ls -l /var/named/usr/local/etc/namedb/ | grep working drwxr-xr-x 2 bind wheel 512 18 jún 21:28 working/ Workaround: 1. remove allow-new-zones from named.conf or 2. remove named_chrootdir from rc.conf or 3. disable support for LMDB With removed named_chrootdir bind creates files _default.nzd and _default.nzd-lock # ls -l /var/named/usr/local/etc/namedb/working/ total 16 -rw------- 1 bind wheel 8192 18 jún 21:30 _default.nzd -rw------- 1 bind wheel 8192 18 jún 21:30 _default.nzd-lock
If you remove named_chrootdir to create the two files, does it still work when you add it back?
Also, this: # mkdir -p /var/named/usr/local/etc # cd /usr/local/etc/ && mv mv namedb /var/named/usr/local/etc/ # ln -s /var/named/usr/local/etc/namedb is quite strange, the rc script should do that for you automatically upon startup. Do you really require it?
(In reply to Mathieu Arnold from comment #1) No, bind still complains about missing _default.nzd, although it exists in /var/named/usr/local/etc/namedb/working/
(In reply to Mathieu Arnold from comment #2) You are right, running this manually is not necessary, but error remains the same.
Managed to find time today to figure out what was wrong, turns out it was totally not what I was expecting. Thanks for the bug report.
A commit references this bug: Author: mat Date: Fri Aug 24 11:49:36 UTC 2018 New revision: 477957 URL: https://svnweb.freebsd.org/changeset/ports/477957 Log: Permit using allow-new-zones, LMDB, and a chrooted environment. Fixes this obscure and not at all helpful message: mdb_env_open of '_default.nzd' failed: No such file or directory PR: 229125 Reported by: Tom?? ?iernik MFH: 2018Q3 Changes: head/dns/bind9-devel/Makefile head/dns/bind9-devel/files/BIND.chroot.dist head/dns/bind911/Makefile head/dns/bind911/files/BIND.chroot.dist head/dns/bind912/Makefile head/dns/bind912/files/BIND.chroot.dist head/dns/bind913/Makefile head/dns/bind913/files/BIND.chroot.dist
A commit references this bug: Author: mat Date: Fri Aug 24 11:50:34 UTC 2018 New revision: 477958 URL: https://svnweb.freebsd.org/changeset/ports/477958 Log: MFH: r477957 Permit using allow-new-zones, LMDB, and a chrooted environment. Fixes this obscure and not at all helpful message: mdb_env_open of '_default.nzd' failed: No such file or directory PR: 229125 Reported by: Tom?? ?iernik Changes: _U branches/2018Q3/ branches/2018Q3/dns/bind9-devel/Makefile branches/2018Q3/dns/bind9-devel/files/BIND.chroot.dist branches/2018Q3/dns/bind911/Makefile branches/2018Q3/dns/bind911/files/BIND.chroot.dist branches/2018Q3/dns/bind912/Makefile branches/2018Q3/dns/bind912/files/BIND.chroot.dist branches/2018Q3/dns/bind913/Makefile branches/2018Q3/dns/bind913/files/BIND.chroot.dist
All you will have to do is update to one of: bind9-devel-9.13.1.a0.2018.08.17_1 bind911-9.11.4P1_1 bind912-9.12.2P1_1 bind913-9.13.2_1 and restart the service. (If you edited /usr/local/etc/mtree/BIND.chroot.dist you will have to merge the tmp directory.)
I can confirm this bug is solved. Thank you very much for your work!