Bug 193255 - Error on custom local_unbound configuration
Summary: Error on custom local_unbound configuration
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: Normal Affects Some People
Assignee: Dag-Erling Smørgrav
URL:
Keywords: patch-ready
Depends on:
Blocks:
 
Reported: 2014-09-02 13:46 UTC by garrych
Modified: 2015-07-08 17:37 UTC (History)
2 users (show)

See Also:


Attachments
move load_rc_config command (785 bytes, patch)
2014-09-02 13:48 UTC, garrych
no flags Details | Diff
A patch to add the default values into etc/defaults/rc.conf. (2.44 KB, patch)
2014-09-05 06:52 UTC, Hiroki Sato
no flags Details | Diff
Revised patch to add the default values into etc/defaults/rc.conf. (2.44 KB, patch)
2014-09-08 09:14 UTC, Hiroki Sato
no flags Details | Diff
/etc/rc.d/local_unbound patch (608 bytes, patch)
2014-09-08 11:38 UTC, garrych
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description garrych 2014-09-02 13:46:35 UTC
If I add some local_unbound_* configuration parameters to /etc/rc.conf they are overwritten by startup script.

I've moved the first occurrence of a string "load_rc_config $name" before evaluating these parameters.
Comment 1 garrych 2014-09-02 13:48:26 UTC
Created attachment 146680 [details]
move load_rc_config command
Comment 2 Hiroki Sato freebsd_committer 2014-09-05 06:52:52 UTC
Created attachment 146844 [details]
A patch to add the default values into etc/defaults/rc.conf.

It is wrong that the default values are defined in the current script, not the location of load_rc_config().  Can you try the attached patch and let me know if it works or not?
Comment 3 garrych 2014-09-05 10:46:25 UTC
(In reply to Hiroki Sato from comment #2)
> Created attachment 146844 [details]
> A patch to add the default values into etc/defaults/rc.conf.
> 
> It is wrong that the default values are defined in the current script, not
> the location of load_rc_config().  Can you try the attached patch and let me
> know if it works or not?

Thanks. Will try it out. But will it work:

do_as_unbound ${unbound_program%/*}/unbound-anchor

I don't see ${unbound_program%/* defined.
Comment 4 Hiroki Sato freebsd_committer 2014-09-08 09:14:55 UTC
Created attachment 147052 [details]
Revised patch to add the default values into etc/defaults/rc.conf.

Sorry, there were typos in the previous patch.  Please try this one.  Thank you.
Comment 5 commit-hook freebsd_committer 2014-09-08 09:33:57 UTC
A commit references this bug:

Author: des
Date: Mon Sep  8 09:33:43 UTC 2014
New revision: 271257
URL: http://svnweb.freebsd.org/changeset/base/271257

Log:
  Use the correct idiom for default values, and ensure that the script
  works correctly if the user overrides them.

  PR:		193255
  Submitted by:	hrs@
  MFC after:	3 days

Changes:
  head/etc/defaults/rc.conf
  head/etc/rc.d/local_unbound
Comment 6 Hiroki Sato freebsd_committer 2014-09-08 10:03:29 UTC
My apologies.  Garret pointed out a typo in my patch to defaults/rc.conf:

 +local_unbound_forwardconf="${local_unbound_workdir}/forward.conf}"

(extra "}")
Comment 7 garrych 2014-09-08 10:24:26 UTC
local_unbound_flags="-c${local_unbound_config}" should definitely be evaluated later in a code. If I setup my custom config file in /etc/rc.conf for local_unbound it will not pass to through local_unbound_flags to the daemon.
Comment 8 garrych 2014-09-08 11:38:37 UTC
Created attachment 147061 [details]
/etc/rc.d/local_unbound patch

Evaluate local_unbound_flags later in the startup script.
Comment 9 Glen Barber freebsd_committer 2015-07-08 17:37:24 UTC
Close PRs that have a corresponding commit to resolve the issue.