From owner-freebsd-questions@FreeBSD.ORG Sat Aug 22 15:42:27 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DC38106568E for ; Sat, 22 Aug 2009 15:42:27 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4C18FC12 for ; Sat, 22 Aug 2009 15:42:26 +0000 (UTC) Received: by ewy5 with SMTP id 5so1976276ewy.36 for ; Sat, 22 Aug 2009 08:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=jGJXlvHZ/DKEKjHSDMefTw9oOuJBscm2dllBmobWFhU=; b=frOhDZcKappinIIBxPqQs6JK8lAnB55OD4mUcCU/iLOUKUJlTuF5UiX4ZXU0C0YjVu PvqlNnFcpvceGcE4TDWJsx4tNT6PV19JhJqVpf3pcUjvXs1uH6Od9F/pGblZaelq/ONP TkX5l5RCJzNLCHWMe7f2twrkmg3rJMLfhzrRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=eUt/MZC7dY1eWcOVtlFBRkZ4SaoFEdro9++pFPupzUEfCC3ao+4NqIsAjNP6HoJfzV EioRdPHKcp5mNuB84Zr7rmAI7FCo6zGa1UgrlwXqIi/NJbSBKtmtnkO5pAPnhVL3QGiI ddvxmLOuR5LO/Mttd/CyDMPhNsg1GQIFYCtGI= Received: by 10.216.93.16 with SMTP id k16mr504204wef.33.1250955745314; Sat, 22 Aug 2009 08:42:25 -0700 (PDT) Received: from gumby.homeunix.com (bb-87-81-140-128.ukonline.co.uk [87.81.140.128]) by mx.google.com with ESMTPS id i6sm15270788gve.7.2009.08.22.08.42.23 (version=SSLv3 cipher=RC4-MD5); Sat, 22 Aug 2009 08:42:24 -0700 (PDT) Date: Sat, 22 Aug 2009 16:42:19 +0100 From: RW To: freebsd-questions@freebsd.org Message-ID: <20090822164219.1d439ae4@gumby.homeunix.com> In-Reply-To: <560f92640908212137s376f1dc8vaba59618a6b71d67@mail.gmail.com> References: <560f92640908212137s376f1dc8vaba59618a6b71d67@mail.gmail.com> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.5; i386-portbld-freebsd7.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: /etc/rc.d/named dilemma X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2009 15:42:27 -0000 On Fri, 21 Aug 2009 21:37:09 -0700 Nerius Landys 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"