Re: [chrony-users] chrony usecase - to set the system time if the system have no RTC

[ Thread Index | Date Index | More Archives ]

On Fri, Dec 18, 2015 at 09:20:20AM +0000, Jahagirdar, Bhushan wrote:
> I was testing chronyd on an embedded system that has no RTC. So the expectation is chronyd should set the system time from any of the source feed and set the system time even if the current system time is set to epoch.

Yes, that's supposed to work.

> As there is no RTC on the system, the system time is always set to epoch on every restart. With this scenario I see chronyd is not setting the system time. After debugging the code, I figured out that valid_sample_time(RCL_Instance instance, struct timeval *tv) function fails because LCL_ReadRawTime() fetches the local time. And in my case this is epoch time and hence the diff is less than 0.

Ok, so this happens with a reference clock? What is the source?

valid_sample_time() compares the time of the sample, as measured by
the system clock, with the current system time to see if the sample is
not too old and can be used for synchronisation. If the clock is in
1970, the refclock sample time should be in 1970 too.

Maybe the program that is feeding chronyd has switched the sample time
with reference time?

Miroslav Lichvar

To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.

Mail converted by MHonArc 2.6.19+