NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ntpdate problem



> On Jul 24, 2024, at 1:19 PM, Will Senn <will.senn%gmail.com@localhost> wrote:
> 
> On 7/24/24 11:51 AM, Joel wrote:
>> 
>> Depending on how you acquire a network address and DNS address, you might not have access to your DNS yet?
>> 
>> You can set ntpdate=NO in /etc/rc.conf to prevent running ntpdate at startup.
>> 
>> -Joel
>> 
>> 
> Yes, that seems to be the problem. I'm using wifi (wpa_supplicant, etc) and I'm gonna guess that it's not completely up and running (ip configured, etc) before the ntpdate command fires. I did nslookup on 2.netbsd.pool.ntp.org and added four server lines to /etc/ntp.conf using those ips. I commented out the pool line and no error.
> 
> Is there a way to ensure the network's completely up before ntpdate is allowed to run? I hunted around for solutions and found some that didn't do the job.

You can pass the -w flag to dhcpcd which makes dhcpcd wait until it is assigned an address, which would be the same time that it receives domain name servers from the domain_name_servers option.

You could also put a dhcpcd hook (see dhcpcd-run-hooks(8)) in /libexec/dhcpcd-hooks that runs ntpdate at the appropriate time.

> Thanks,
> Will



Home | Main Index | Thread Index | Old Index