On Wed, Mar 16, 2022 at 11:55:27PM +0100, Martin Pecka wrote:
> > People naively want a simple Boolean flag. However, the reality is
> > that there is no simple answer to the question, is my computer
> > synchronized.
> Well, that is actually what people expect from a time sync daemon. Chrony
> has it (* or + in `chronyc sources`),
* or + only tells you whether a time source is selected for
synchronization, nothing about the clock actually being synchronized,
no matter what definition you have for that. It's a common
misconception. In PTP that would be a port being in the slave state.
On systemd-based distributions there is a "time-sync" target, after
which can be ordered start of services that require "synchronized"
clock. With the chrony-wait service, the time-sync target is reached
when the reported remaining correction of the clock is less than 100
milliseconds.
With ptp4l or phc2sys, you would just wait for the first non-zero
offset smaller than some value (e.g. 1000 nanoseconds).
> systemd has it ("System clock synchronized: yes" in timedatectl)
'yes' is reported by timedatectl when the maxerror value of the system
clock (from adjtimex() or ntp_gettime()) is smaller than 16 seconds.
That normally happens on the first update of the clock. timedated/ctl
doesn't know what is actually controlling the clock. This works even
with ptp4l (if SW timestamping) and phc2sys.
--
Miroslav Lichvar
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel