I'm working on some devices where I want them to self-synchronise while their network connection is down (i.e. use chrony's calculations of drift rates to compensate for system clock drift), and then sync normally when remote connectivity is available.
Unfortunately, chronyd fails to bind to the NTP listening port, and actively attempts to sends packets to the NTP pseudo-server address, and I'm having trouble working out if that is expected behaviour or not.
chrony.conf settings recommended for self-synchronisation are:
server 127.127.1.0 # Self-synchronise allow 127.0.0.0/8 # NTP server for the local system, not just a client local stratum 10 # Serve low quality time even when the remote link is down
However, when I run
chrony sources with that configuration, it claims that it hasn't synchronised with the pseudo-time server for
chronyc sources 210 Number of sources = 1 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^? 127.127.1.0 0 7 0 - +0ns[ +0ns] +/- 0ns
chrony tracking does seem to suggest that it is working as expected:
$ chronyc tracking Reference ID : 7F7F0101 () Stratum : 10 Ref time (UTC) : Mon Jun 04 08:27:11 2018 System time : 0.000000007 seconds fast of NTP time Last offset : +3.297439098 seconds RMS offset : 3.297439098 seconds Frequency : 466.833 ppm slow Residual freq : +0.000 ppm Skew : 0.000 ppm Root delay : 0.000000000 seconds Root dispersion : 0.000000000 seconds Update interval : 0.0 seconds Leap status : Normal
No matter how I adjust the
allow settings in the config file I cannot get
chronyd to show up as actually listening on UDP port
123 on any of the machine's interfaces, whereas I'd expect to see that in
netstat -ulnp if I've successfully set it up to act as a time server.
Even more strangely, if I run
strace -f, I see it attempting to actually send messages to
127.127.1.0, even though it should know that that's the pseudo-address for local time synchronisation.
As things stand, I have very little confidence that
chrony is actually compensating for clock drift while the remote connection is down, since it's tricky to provoke a situation where it actually does need to automatically correct for clock drift.
So my actual question is: does anyone know how to tell if chrony is correctly set up for self-synchronisation when offline? Or do I just need to deploy this as I currently have it configured, and then wait and see whether or not we have problems with clocks drifting while devices are disconnected from their backend management server?