Re: [chrony-users] leapsectz and phc refclock offset

[ Thread Index | Date Index | More Archives ]

On Thu, Sep 21, 2017 at 03:49:25PM -0400, Chris Perl wrote:
> I have chrony servers that are using phc refclocks.  Those refclocks are
> kept in TAI, so I have to specify the current TAI-UTC offset in the
> `refclock' directive ("offset -37").

Is the PHC synchronized by ptp4l? You could use phc2sys -E ntpshm to
get the reference time in UTC in a SHM segment and use that in chrony
with the SHM refclock instead.

An advantage of this approach is that chronyd will stop accumulating
new samples when the PHC is no longer synchronized as phc2sys is
continuously checking state of the PTP port.

Another possibility is to configure the PHC refclock with the pps
option, so it would use only the sub-second offset. This assumes an
additional source (NTP server or non-PPS refclock) is available.

> Is the idea of the leapsectz directive just that your refclock gives you
> whatever time it gives you (perhaps TAI, perhaps UTC) and the timezone
> files are just used so chrony can, for example, arm the kernel (if
> leapsecmode is system) and advertise the impending leap second to
> downstream clients?

Yes, currently leapsectz is just an additional source of leap seconds
and it sets the TAI-UTC offset of the system clock, so applications
using clock_gettime(CLOCK_TAI) get correct time.

> Assuming I'm not misunderstanding, would it be possible to add something to
> allow the TAI-UTC offset to be dynamically calculated using the timezone
> files for refclocks?

I think a new "tai" option could be added for refclocks. If specified,
the refclock code would call something like REF_GetTaiOffset() and add
(or substract?) the value to offset in all samples.

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+