If a different conf-file is passed to unbound with > unbound_flags=" -c /var/unbound/unbound.conf" unbound will fail to start with error > unbound-checkconf[81255:0] fatal error: config file /usr/local/etc/unbound/unbound.conf is not inside chroot /var/unbound This can be fixed by adding /var/unbound/unbound.conf to the rc-script in the unbound-checkconf line in pre-cmd Probably the rc script needs to be amended to allow passing a config file and pass that to unbound-checkconf and (incl. -c) to unbound.
Created attachment 190012 [details] patch to mitigate the problem This patch will have the desired effect when you add unbound_conf="/var/unbound/unbound.conf" to /etc/rc.conf Note that you have to tailor that config file to your needs
Updated my port and this is working fine. That was roughly what I was expecting, thanks! Works fine here, want me to commit it? (PORTREVISION bump?)
I talked with the developers and there will be a release in a couple of weeks so I wanted to wait for that. A revision bump is likely an overkill since I don't expect that a lot of people will change the default.
A commit references this bug: Author: brnrd Date: Fri Jan 26 10:16:17 UTC 2018 New revision: 459983 URL: https://svnweb.freebsd.org/changeset/ports/459983 Log: dns/unbound: Fix rc-script with config in flags - Adds new option unbound_config PR: 225360 Submitted by: jaap@NLnetLabs.nl Approved by: jaap@NLnetLabs.nl (maintainer) Changes: head/dns/unbound/files/unbound.in