Subject: Re: Is setting ntpdate in rc.conf `safe` in all cases?
To: Simon Burge <simonb@wasabisystems.com>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-users
Date: 10/21/2001 09:50:23
On Mon, 22 Oct 2001, Simon Burge wrote:

> > I'd like to set ntpdate=YES in my rc.conf file, but I wonder if it's
> > `safe` in all cases. I guess that for example when no network connectivity
> > would be available, ntpdate would just exit, and not wait forever
> > trying to resolve/connect to the given server. I'd like to be entirely
> > sure that it wouldn't prevent my box from starting properly
> > in that cases. Can anyone comment on this?
>
> Perhaps the longest delay will be waiting for any DNS timeouts if you
> have a netword card configured.  If you can live with a minute or two
> delay, you don't need to do any more.
>
> I _think_ dhclient can call a script once it obtains a lease, which
> implies the network is up (although I've never used this feature - if it
> exists).  If this is possible, you could have "ntpdate=NO" in rc.conf,
> but have "/etc/rc.d/ntpdata forcestart" in the script that dhclient runs
> (the "force" prefix making it ignore the =NO in rc.conf).

It doesn't hurt anything to run "ntpdate" with the network down. The
default is to try every peer in "/etc/ntp.conf", and that takes about
two minutes per peer to timeout when there is no connectivity. If
that's too long, or too short, you can add a "-t timeout" option to
"ntpdate_flags" in "/etc/rc.conf".

Frederick