Bug 238753 - /etc/rc.d/local_unbound fails to honor configuration directory setting post-start
Summary: /etc/rc.d/local_unbound fails to honor configuration directory setting post-s...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 12.0-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-rc mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2019-06-21 19:52 UTC by karl
Modified: 2019-06-21 20:09 UTC (History)
0 users

See Also:


Attachments
Address missing "-c" flag on the control command (623 bytes, text/plain)
2019-06-21 19:52 UTC, karl
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description karl 2019-06-21 19:52:39 UTC
Created attachment 205269 [details]
Address missing "-c" flag on the control command

/etc/rc.d/local_unbound starts the local "unbound" nameserver.

The script assumes the working directory is in /var/unbound, which is valid for most users.  However, in an embedded environment /var is frequently on a ramdisk and not saved (that is, it's volatile), which means you need to move this directory for those environments since otherwise you will be regenerating the configuration on each boot -- and that is probably not desirable.

The base RC script is intended to honor local_unbound_workdir in /etc/rc.conf, but the "local_unbound_poststart()" function makes a call to the "-control" software without specifying the config directory explicitly with "-c".  If the working directory is not in the default location this results in that command failing; this is not fatal since the test gives up after five tries, but it should honor the config directive and thus know when the startup has completed successfully.

The attached patch adds the "-c" flag to the control command and resolves the issue.