From owner-freebsd-ports@freebsd.org Fri Apr 30 16:14:05 2021 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50D2862326B; Fri, 30 Apr 2021 16:14:05 +0000 (UTC) (envelope-from portmaster@bsdforge.com) Received: from udns.ultimatedns.net (static-24-113-41-81.wavecable.com [24.113.41.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ultimatedns.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWy9S595fz4tLM; Fri, 30 Apr 2021 16:14:04 +0000 (UTC) (envelope-from portmaster@bsdforge.com) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.16.1/8.16.1) with ESMTP id 13UGDvUM098285; Fri, 30 Apr 2021 09:14:04 -0700 (PDT) (envelope-from portmaster@bsdforge.com) MIME-Version: 1.0 Date: Fri, 30 Apr 2021 09:13:57 -0700 From: Chris To: Yasuhiro Kimura Cc: freebsd-ports@freebsd.org, freebsd-stable@freebsd.org Subject: Re: How to make 'named' rc script invokded earlier at boot time In-Reply-To: <20210430.163054.429403798691966830.yasu@utahime.org> References: <20210430.163054.429403798691966830.yasu@utahime.org> User-Agent: UDNSMS/17.0 Message-ID: X-Sender: portmaster@bsdforge.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FWy9S595fz4tLM X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:11404, ipnet:24.113.0.0/16, country:US]; local_wl_ip(0.00)[24.113.41.81] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 16:14:05 -0000 On 2021-04-30 00:30, Yasuhiro Kimura wrote: > I installed dns/bind916 on my home server and configured it so it > worked as both authoritative and recursor. Then I added > 'nameserver 127.0.0.1' to /etc/resolv.conf and everything worked fine. > > But after updating OS from 12.2-RELEASE to 13.0-RELEASE I noticed > execution of some rc scripts fails at boot time because of DNS lookup > error. And I also found these scripts are executed earlier than > 'named'. I've been plagued with this for years (well, a couple anyways) on several of my servers. As I never saw anyone else mention it. I assumed it was just "me". ;-) rc(8) has a mountlate. Seems to me there ought to be a "startlate" key as well. While this won't fix the cause introduced. It might at least solve the problem. create an /etc/rc.conf.local and move your host/nic related things into it followed by your "named" entry. Leaving everything else in /etc/rc.conf This (should) source all the rc.conf.local entries ahead of the rc.conf entries. Thereby providing name resolution before ntpdate(8)/time sync service(s) HTH --Chris > > Now let me use 'ntpdate' as an example. > > If I run `rcorder /etc/rc.d/* /usr/local/etc/rc.d/*` on 12.2-RELEASE, > then I get following result. > > ---------------------------------------------------------------------- > root@rolling-vm-freebsd3[474]# uname -a > FreeBSD rolling-vm-freebsd3.home.utahime.org 12.2-RELEASE-p6 FreeBSD > 12.2-RELEASE-p6 GENERIC amd64 > root@rolling-vm-freebsd3[475]# rcorder /etc/rc.d/* /usr/local/etc/rc.d/* > /etc/rc.d/growfs > /etc/rc.d/sysctl > /etc/rc.d/hostid > /etc/rc.d/zvol > /etc/rc.d/dumpon > (snip) > /etc/rc.d/static_arp > /etc/rc.d/bridge > /etc/rc.d/route6d > /etc/rc.d/NETWORKING > /etc/rc.d/mountcritremote > /etc/rc.d/devfs > /etc/rc.d/ipmon > /etc/rc.d/kdc > /etc/rc.d/mdconfig2 > /etc/rc.d/newsyslog > /etc/rc.d/syslogd > /usr/local/etc/rc.d/tcsd > /usr/local/etc/rc.d/named > /etc/rc.d/watchdogd > /etc/rc.d/savecore > /etc/rc.d/archdep > /etc/rc.d/linux > /etc/rc.d/sysvipc > /etc/rc.d/SERVERS > /usr/local/etc/rc.d/tpmd > /usr/local/etc/rc.d/stunnel > /etc/rc.d/accounting > /etc/rc.d/ntpdate > /etc/rc.d/rpcbind > /etc/rc.d/nfsclient > /etc/rc.d/nisdomain > (snip) > ---------------------------------------------------------------------- > > As you can see, while 'named' is executed before SERVERS, 'ntpdate' is > done after it. > > On the other hand I get following result on 13.0-RELEASE. > > ---------------------------------------------------------------------- > root@rolling-vm-freebsd2[332]# uname -a > FreeBSD rolling-vm-freebsd2.home.utahime.org 13.0-RELEASE FreeBSD > 13.0-RELEASE #0 > releng/13.0-n244733-ea31abc261f: Fri Apr 9 04:24:09 UTC 2021 > root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 > root@rolling-vm-freebsd2[333]# rcorder /etc/rc.d/* /usr/local/etc/rc.d/* > /etc/rc.d/dhclient > /etc/rc.d/dumpon > /etc/rc.d/growfs > /etc/rc.d/natd > (snip) > /etc/rc.d/netwait > /etc/rc.d/blacklistd > /etc/rc.d/local_unbound > /etc/rc.d/NETWORKING > /etc/rc.d/pppoed > /etc/rc.d/kdc > /etc/rc.d/kfd > /etc/rc.d/nfsuserd > /etc/rc.d/iscsid > /etc/rc.d/ipropd_slave > /etc/rc.d/nfscbd > /etc/rc.d/iscsictl > /etc/rc.d/ipropd_master > /etc/rc.d/kadmind > /etc/rc.d/kpasswdd > /etc/rc.d/mountcritremote > /etc/rc.d/wpa_supplicant > /etc/rc.d/motd > /etc/rc.d/accounting > /etc/rc.d/cleartmp > /etc/rc.d/dmesg > /etc/rc.d/archdep > /etc/rc.d/gptboot > /etc/rc.d/hostapd > /etc/rc.d/virecover > /etc/rc.d/mdconfig2 > /etc/rc.d/devfs > /etc/rc.d/os-release > /etc/rc.d/newsyslog > /etc/rc.d/linux > /etc/rc.d/syslogd > /etc/rc.d/sysvipc > /etc/rc.d/watchdogd > /etc/rc.d/savecore > /etc/rc.d/ntpdate > /etc/rc.d/localpkg > /etc/rc.d/auditd > /etc/rc.d/bsnmpd > /etc/rc.d/pwcheck > /etc/rc.d/power_profile > /etc/rc.d/rpcbind > /etc/rc.d/auditdistd > /usr/local/etc/rc.d/named > /etc/rc.d/nfsclient > /etc/rc.d/hastd > /etc/rc.d/SERVERS > /etc/rc.d/nisdomain > /usr/local/etc/rc.d/stunnel > /usr/local/etc/rc.d/tpmd > /usr/local/etc/rc.d/tcsd > (snip) > ---------------------------------------------------------------------- > > Now both 'named' and 'ntpdate' are executed before SERVERS. And > unfortunately the latter is earlier than the former. So it is natural > that execution of 'ntpdate' fails with DNS lookup failure. > > I compared ntpdate rc script between releng/12.2 and releng/13.0 but > there is no difference. > > ---------------------------------------------------------------------- > yasu@rolling-vm-freebsd2[1035]% pwd > /usr/src > yasu@rolling-vm-freebsd2[1036]% git diff origin/releng/12.2 > origin/releng/13.0 -- > libexec/rc/rc.d/ntpdate > yasu@rolling-vm-freebsd2[1037]% > ---------------------------------------------------------------------- > > And of cource there is no difference with /usr/local/etc/rc.d/named > either. So it seems evaluation of rcorder(8) is changed between > 12.2-RELASE and 13.0-RELEASE. > > Then is there any way to make 'named' rc script invoked earlier at > boot time on 13.0-RELEASE? > > Best Regards. > > --- > Yasuhiro Kimura > _______________________________________________ > freebsd-ports@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"