RE: [chrony-users] chrony usecase - to set the system time if the system have no RTC |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
Hi Miroslav,
>Ok, so this happens with a reference clock? What is the source?
Yes the time source is from a SOCK reference clock.
>Maybe the program that is feeding chronyd has switched the sample time with reference time?
Can you please let me know more details on what is sample time and reference time and how to feed this to chronyd? Is there any documentation that points to the specifications that are needed in client application that feeds reference time to chronyd?
--
Thanks and Regards,
Bhushan J.
-----Original Message-----
From: Miroslav Lichvar [mailto:mlichvar@xxxxxxxxxx]
Sent: Friday, December 18, 2015 3:06 PM
To: chrony-users@xxxxxxxxxxxxxxxxxxxx
Subject: Re: [chrony-users] chrony usecase - to set the system time if the system have no RTC
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.
--
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.