[ntp:questions] Re: sntp output for bootstrapping system time
Richard B. Gilbert
rgilbert88 at comcast.net
Mon Nov 21 21:53:22 UTC 2005
Christopher Nelson wrote:
>The SNTP README says:
> WARNING: adjtime is more than a bit sick on many systems, and will
> ignore large corrections, usually without any form of hint that it
> has done so. It is often (even usually) necessary to reset the
> clock to approximately the right time using the -r option before
> using the -a and -x options to keep it correct.
> sntp -r ntp.mydomain.com
>and it prompted me about the big difference then ignored me when I said
>Y to the prompt.
>So I tried to do something like:
> # Get the approximate date
> date -s `sntp ntp.mydomain.com | somefilter`
> # Fix it up with NTP
> sntp ntp.mydomain.com
>but I'm having trouble coming up with filter that massages sntp output
>to date input without what seems to be undue complexity. Is there
>something I'm missing? Is there an SNTP option to generate output
>compatible with date?
You could try using ntpdate to set the time initially. Ntpdate is
deprecated for good and sufficient reasons but is still available. It
will set the time unconditionally after first getting the time from a
server or servers. There is some risk involved because ntpdate lacks
defenses against servers with bad time.
More information about the questions