Date: Sat, 22 Aug 2009 16:42:19 +0100 From: RW <rwmaillists@googlemail.com> To: freebsd-questions@freebsd.org Subject: Re: /etc/rc.d/named dilemma Message-ID: <20090822164219.1d439ae4@gumby.homeunix.com> In-Reply-To: <560f92640908212137s376f1dc8vaba59618a6b71d67@mail.gmail.com> References: <560f92640908212137s376f1dc8vaba59618a6b71d67@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 21 Aug 2009 21:37:09 -0700
Nerius Landys <nlandys@gmail.com> wrote:
> Then why
> can't I do a lookup right after named starts?
Possibly it's a delay in bind being ready or maybe you don't have any
network access - the latter is common with ppp.
> By the way, the underlying issue that I'm trying to address is that
> ntpdate, which comes right after named in the boot sequence, is not
> able to resolve the DNS for the time servers.
Try putting the following in /usr/local/etc/rc.d/waitfordns and make it
executable (untested)
#!/bin/sh
#
# PROVIDE: waitfordns
# REQUIRE: named
# BEFORE: ntpdate
. /etc/rc.subr
: ${waitfordns_enable:=yes}
name=waitfordns
rcvar=`set_rcvar`
stop_cmd=":"
start_cmd="waitfordns_start"
waitfordns_start(){
/usr/bin/dig +time=1 +retry=99 @127.0.0.1 google.com 2>&1 > /dev/null
}
load_rc_config ${name}
run_rc_command "$1"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090822164219.1d439ae4>
