Re: [chrony-users] Discover when a time sync has been performed

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]



What makestep? The offset is always within a millisecond of the right time.
There is no need for any step anywhere in the file. Not sure what you are expecting?


On Thu, 4 Jul 2013, Ignacio Verona R� wrote:

Hi Miroslav,

thanks for your answer. It partially solves my question, but I'm not able
to see the entry in the tracking log when makestep is applied. Last lines
of the file look like this:

2013-07-04 12:59:20 193.145.56.7     3     36.888     27.043 -1.121e-09

2013-07-04 12:59:22 193.145.56.7     3     36.888     27.042 -1.999e-10

2013-07-04 12:59:25 193.145.56.7     3     36.888     27.041 -8.009e-11

2013-07-04 12:59:28 193.145.56.7     3     36.888     27.041 -1.750e-11

2013-07-04 12:59:30 193.145.56.7     3     36.888     27.041 -3.122e-12

2013-07-04 12:59:33 193.145.56.7     3     36.888     27.041 -1.252e-12

2013-07-04 12:59:36 193.145.56.7     3     36.888     27.041 -2.735e-13

2013-07-04 12:59:38 193.145.56.7     3     36.888     27.041 -4.878e-14

2013-07-04 12:59:41 193.145.56.7     3     36.888     27.041 -1.955e-14

2013-07-04 13:02:29 193.145.56.7     3     36.888     27.041 -2.559e-13

=======================================================================

   Date (UTC) Time     IP Address   St   Freq ppm   Skew ppm     Offset

=======================================================================

2013-07-04 13:02:29 193.145.56.7     3     35.372     25.842 -9.218e-03

2013-07-04 13:02:35 193.145.56.7     3     35.053     24.987 -2.218e-06

2013-07-04 13:02:37 193.145.56.7     3     34.981     24.662 -1.912e-07

2013-07-04 13:02:37 193.145.56.7     3     51.432     44.243  1.820e-02

2013-07-04 13:02:41 193.145.56.7     3     62.654     44.994  1.025e-02

2013-07-04 13:02:45 193.145.56.7     3     61.990     45.978 -1.239e-02

2013-07-04 13:02:49 193.145.56.7     3     62.469     43.023  2.828e-03

2013-07-04 13:05:05 193.145.56.7     3     77.812     57.165  7.208e-02

2013-07-04 13:05:13 193.145.56.7     3     82.492     50.649 -2.832e-03

2013-07-04 13:05:17 193.145.56.7     3     82.620     46.004 -2.830e-03

2013-07-04 13:05:21 193.145.56.7     3     82.127     43.920 -2.164e-03

2013-07-04 13:05:25 193.145.56.7     3     81.555     42.269 -1.921e-03



Should I expect some "Makestep OK" message? or it's a different state?

Thanks for your help.


2013/7/4 Miroslav Lichvar <mlichvar@xxxxxxxxxx>

On Thu, Jul 04, 2013 at 12:32:10PM +0200, Ignacio Verona R� wrote:
My question is about checking when a time sync has been performed. I'm
developing an application where time sync is important. It's running on a
Raspberry Pi, so time is not very good kept. When the net connection is
started I notify chrony about the sources being online, and the config is
set to execute a "makestep" if more than 10secs deviation is found.

But, how may I check if the sycn (makestep) is already done? I've been
searching the logs (syslog, tracking, measurements) but don't know what
may
trigger my "Sync ok!" event.

If the measured offset is larger than the makestep limit, chronyd will
correct the error immediately. When that happens, a message is written
to the system log and there should be an entry in the tracking log
too if it's enabled.

If the offset is below the makestep limit, it will be corrected slowly
by slewing. You can monitor the remaining correction in the "System
time" field in the tracking report.

Maybe looking at the offset value and setting some threshold, so if it's
lower it's ok for the app to continue?

It depends on what exactly you want to check. You can use the chronyc
waitsync command, it waits for the remaining correction (and
optionally also for the skew) to be smaller than a specified limit.

If you need also to be sure that an update was actually performed
after the sources were set online, you will need to check the time
stamps in tracking log or check if the Ref time field in the tracking
report has changed.

Does this answer your question?

--
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.




--
William G. Unruh   |  Canadian Institute for|     Tel: +1(604)822-3273
Physics&Astronomy  |     Advanced Research  |     Fax: +1(604)822-5324
UBC, Vancouver,BC  |   Program in Cosmology |     unruh@xxxxxxxxxxxxxx
Canada V6T 1Z1     |      and Gravity       |  www.theory.physics.ubc.ca/


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/