[ntp:questions] Getting SNTP to accept large corrections

Richard B. Gilbert rgilbert88 at comcast.net
Wed Jan 16 21:17:47 UTC 2008


Christopher Nelson wrote:
> On Jan 16, 3:44 pm, "Richard B. Gilbert" <rgilber... at comcast.net>
> wrote:
> 
>>Christopher Nelson wrote:
>>
>>>I have a system without a battery-backed clock and I want to get some
>>>semblance of the right time at boot up using sntp.  Since the time
>>>starts out decades off, I need to accept a large correction on my
>>>initial request.  I'm using sntp from NTP 4.2.4p0 and I don't seem to
>>>be able to convince it to just take whatever time is provided.  I
>>>ended up patching it to have a prompt threshold of INT_MAX but I'd
>>>rather have a command line option that said, "Just this once, trust
>>>me."  Is that expectation way off?  Is anyone else using sntp to get
>>>an initial clock setting when the default time is way off?  How do you
>>>cope with that?
>>
>>Have you tried starting ntpd with the -g option?  This is supposed to
>>tell ntp to set the clock to a reasonable approximation of the correct
>>time at startup.  It doesn't care if you're off by ten seconds or ten years!
> 
> 
> How does it know what the correct time is so that it can determine a
> reasonable approximation?  Are you saying that it should set the time,
> regardless of the delta?

It queries the servers that you configure and determines the correct 
time in its normal manner.  The only difference is that -g allows it to 
"step" the clock when it would otherwise not be permitted to do so.




More information about the questions mailing list