Bug 226484

Summary: dns/unbound unable to stop through rc.d script when specifying alternate PID file location
Product: Ports & Packages Reporter: Dries Michiels <driesm>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed Not A Bug    
Severity: Affects Only Me CC: jaap
Priority: --- Flags: jaap: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   

Description Dries Michiels freebsd_committer freebsd_triage 2018-03-09 18:16:09 UTC
When speficying an alternate location of the PID file. The rc.d script is unable to determine PID file location after that the daemon has started.

I have the following settings in unbound.conf:
        chroot: ""
        directory: "/usr/local/etc/unbound"
        pidfile: "/var/run/unbound.pid"

When starting unbound, the program creates the PID file at the location specified. All good here.

When issuing "service unbound stop" the following output is reflected:
unbound not running? (check /usr/local/etc/unbound/unbound.pid).

While it is running. It seems like the PID file is hardcoded in the source.
Or not? Because I'd think it isn't as its a setting in unbound.conf. Altough it reflects the daemon can't handle an alternate PID file location.
Comment 1 Dries Michiels freebsd_committer freebsd_triage 2018-03-09 18:21:06 UTC
OK, nvm. Specifying the pid in rc.conf as "unbound_pidfile" fixes this issue.
Comment 2 Jaap Akkerhuis 2018-03-09 20:34:19 UTC
(In reply to Duffyx from comment #1)

You can use "unbound-checkconf -o pidfile" to pick up the value unbound is actually using. I'll add that to the rc script in the next release (if I don't forget).

        jaap