Bug 255897

Summary: dns/powerdns-recursor fails to start if pdns_recursor_flags rc var is set
Product: Ports & Packages Reporter: Alessandro Sagratini <ale_sagra>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: tremere
Priority: --- Flags: tremere: maintainer-feedback-
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256530
Attachments:
Description Flags
rc.d script none

Description Alessandro Sagratini 2021-05-15 13:06:53 UTC
Hello,
I'm reaching out because, since this [1] commit, powerdns-recursor no longer starts if pdns_recursor_flags rc var is set.

Reproducing the issue should be fairly simple, just set 
pdns_recursor_flags="--allow-from=127.0.0.0/8,10.0.0.0/24"

(or anything of your choice) in /etc/rc.conf and restart the service. Following error message should appear
pdns_recursor not running? (check /var/run/pdns_recursor.pid).
Starting pdns_recursor.
daemon: illegal option -- -
usage: daemon [-cfHrS] [-p child_pidfile] [-P supervisor_pidfile]
              [-u user] [-o output_file] [-t title]
              [-l syslog_facility] [-s syslog_priority]
              [-T syslog_tag] [-m output_mask] [-R restart_delay_secs]
command arguments ...
/usr/local/etc/rc.d/pdns-recursor: WARNING: failed to start pdns_recursor

reverting rc script [1] removes the error message.

[1] https://cgit.freebsd.org/ports/commit/dns/powerdns-recursor/files/pdns-recursor.in?id=e5f6c6eee3ac2e99ec07cdb060bc6d19ed898bf1
Comment 1 Ralf van der Enden 2021-05-17 08:35:45 UTC
Hi,

Making the rc.d use /usr/sbin/daemon caused the error you're seeing. Since I dont use the _flags variable myself, I hadn't run into it myself while testing. Sorry about that.

I fixed the script in bug #255842
Comment 2 Alessandro Sagratini 2021-05-17 13:18:11 UTC
Created attachment 225026 [details]
rc.d script

Thank you, be aware that any line with "daemon" should be removed, please find attached a working script.
Comment 3 Ralf van der Enden 2021-06-12 12:21:19 UTC
Please close this PR. Taken care of by bug #256530
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2021-06-12 12:34:32 UTC
^Triage: OBE, see PR 256530.