Re: [chrony-users] Getting time synchronization offset from chronyd

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


Hi Miroslav!

Thanks for your quick answer and proposal for another solution to my problem.

Yes, waitsync works to make sure that the system date is in sync but I
also need to get the correction offset so that I can drop events that
are too much out of sync.

Your proposal seems more an elegant workaround than a real solution...
But at the moment, my choice would be using a named pipe log and parse
it from my application.

In the longer term, do you think it would be possible to send such of
tracking logs over the UNIX sockets as "unsollicted" event? That looks
the cleanest to me ... Any opinion against this? If not, do you think
such feature requests would be welcome?

Best regards,

Guy

On Wed, Jul 15, 2020 at 2:36 PM Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
>
> On Wed, Jul 15, 2020 at 01:53:37PM +0200, Guy Morand wrote:
> > I use *Leap status* to make sure that the time is in sync and *Last
> > offset* to read the time correction.
> >
> > However, after changing the system time to few hours ago and rebooting,
> > I got a time correction of few milliseconds. My assumption is due to the
> > "iburst" parameter, the time got corrected more than once and missed the
> > biggest correction that was of few hours. Is that plausible?
>
> Yes, it's possible to miss a clock update if you poll the daemon using
> chronyc.
>
> > * Am I reading the right field?
> > * Is there a way to get events directly from the chrony daemon when a
> >   time correction was done (UNIX socket) to not misse any time
> >   correction?
> > * Is there a better approach to achieve this?
>
> Depends on what exactly you need. If you just need to wait for the
> clock to be synchronized, maybe the chronyc waitsync command would
> help?
>
> If you really need to know about each clock update, you could enable
> the tracking log. If you don't want it to be saved to disk, you could
> create a named pipe and let chronyd write to that. You could also use
> the mailonchange directive with your own sendmail binary and a small
> threshold (e.g. 1 nanosecond), which chronyd would call on each
> update.
>
> --
> 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.
>


-- 
Guy Morand

Software Engineer

–

Scewo AG, Technoparkstrasse 7, 8406 Winterthur

Office +41 (0)44 500 86 03


www.scewo.ch

www.facebook.com/scewo

www.instagram.com/scewo_official

--
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+ http://listengine.tuxfamily.org/