[ntp:hackers] [gpsd-dev] gpsdate program, similar to 'ntpdate'

Warner Losh imp at bsdimp.com
Fri Jun 21 14:45:51 UTC 2013


On Jun 21, 2013, at 8:01 AM, tsg wrote:

> On 06/21/2013 12:17 AM, Harald Welte wrote:
>> Hi C.J.,
>> 
>> On Thu, Jun 20, 2013 at 03:56:00PM -0700, C.J. Adams-Collier wrote:
>>> I hear ntpdate has been deprecated long time and obsoleted in new releases.
>>> 
>>> Try ntpd -q
>> I have tried this long ago, and would be happy if things would have been
>> that simple.
>> 
>> ntp_refclock:refclock_process_f() calls libntp:clocktime() and the
>> latter aboslutely cannot deal with the fact if e.g. your embedded
>> system without RTC boots up assuming it is January 1st 1970 and a GPS
>> reference time in the year 2013 has been received.
> 
> Why not put a new epoch into the system in the form of a command to set the time as part of the startup. Code a statement into the scripting that sets the time to 2013 if the issue is 1970. But the real problem is the -g switch functionality I think.

All the BSDs set the system time to the last modify time of /, which is always ballpark correct. More so than 1970, 1980, 2000, or any of the other 'default' times.

>> 
>> I looked into fixing the ntpd/libntp code some months ago, but gave up
>> as it seems to be written on the assumption that there simply are not 43
>> years of difference between two timestamps.
> 
> Again - set the initialization time so there isnt.

Yea, that whole not wanting to hard code an epoch thing in ntp not mixing well with 1970 being the unix epoch... 

>> 
>> Having said that, I'm clearly not a ntpd expert and happy to try
>> whatever method people suggest here.  But after lots of debugging and
>> ntp source code reading I arrived at the conclusion that it is not
>> possible using the existing code, which prompted the implementation of
>> gpsdate.
>> 
>> Regards,
>> 	Harald
>> 
> 
> 
> -- 
> // Standard "perasonal email" disclaimers apply
> 
> _______________________________________________
> hackers mailing list
> hackers at lists.ntp.org
> http://lists.ntp.org/listinfo/hackers



More information about the hackers mailing list