Bug 225360

Summary: dns/unbound: service start fails with flags
Product: Ports & Packages Reporter: Bernard Spil <brnrd>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: jaap
Priority: --- Flags: bugzilla: maintainer-feedback? (jaap)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to mitigate the problem jaap: maintainer-approval+

Description Bernard Spil freebsd_committer freebsd_triage 2018-01-21 17:53:03 UTC
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.
Comment 1 Jaap Akkerhuis 2018-01-23 22:40:39 UTC
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
Comment 2 Bernard Spil freebsd_committer freebsd_triage 2018-01-24 11:04:26 UTC
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?)
Comment 3 Jaap Akkerhuis 2018-01-25 22:24:33 UTC
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.
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-01-26 10:16:25 UTC
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