Bug 144400 - [patch] /etc/rc.d/named - $named_wait_host needs an upper bound
Summary: [patch] /etc/rc.d/named - $named_wait_host needs an upper bound
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 8.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ian Lepore
Depends on:
Blocks: 231193
  Show dependency treegraph
Reported: 2010-03-01 21:50 UTC by andy wilson
Modified: 2021-08-23 16:52 UTC (History)
2 users (show)

See Also:

file.diff (1.31 KB, patch)
2010-03-01 21:50 UTC, andy wilson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description andy wilson 2010-03-01 21:50:02 UTC
If you set $named_wait_host to a remote hostname and something is going wrong with the name resolution process for that particular hostname, your system will hang indefinitely. Some services (like ntpd) depend on being able to resolve remote DNS hostnames, but you would still want the system to come up if it is having trouble resolving $named_wait_host.

It would help to have an additional variable that specifies an upper bound for how long /etc/rc.d/named spends attempting to resolve $named_wait_host. That way $named_wait_host can be set to a remote hostname but your system will not be completely dependent on that hostname successfully resolving.

This addition would make it easy to solve problems like the one discussed here:  http://forums.freebsd.org/showthread.php?t=9171

Fix: I've attached patches for /etc/rc.d/named and /etc/defaults/rc.conf ; these patches add and document an optional $named_wait_max variable that sets the maximum number of seconds that rc.d/named will wait while trying to resolve $named_wait_host.

Patch attached with submission follows:
How-To-Repeat: Set up rc.conf with the following variables:


Then run: 
/etc/rc.d/named restart
Comment 1 andy wilson 2010-03-01 23:30:09 UTC
I misfiled this; it should have been filed in conf.  Sorry about that.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2010-03-02 00:36:42 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Fix category and assign.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2010-03-13 21:38:46 UTC
Responsible Changed
From-To: freebsd-rc->dougb

dougb has volunteered to look at named bugs.
Comment 4 Doug Barton freebsd_committer 2010-03-13 21:45:11 UTC
State Changed
From-To: open->closed

I've thought about your PR for a while, and my conclusion is that the 
current setting is doing what it's designed to do. If name resolution 
is critical to the system's function, subverting the _wait option is 
not what we should be doing. If it isn't critical, the user would not 
have set that option in the first place (which defaults to off btw).  

I will keep your PR on record in case this issue resurfaces down the 
road. Meanwhile, thanks for your interest in making FreeBSD better. 

Comment 5 Ian Lepore freebsd_committer 2018-09-06 20:07:23 UTC
I believe it was an error to reject this patch. A problem exists and needs a fix like this for the reasons stated when the bug was opened.  However, I believe the default behavior should be to wait forever unless the user specifically configures some timeout value.  I'm reopening this because it's potentially the fix for bug 231193.