April 13, 2021

Fedora 32 -- set up NTP -- or perhaps chrony

This all started when I discovered that several Fedora machines I have set up were not running NTP as I thought they were. I was under the mistaken impression that Fedora now installed and ran NTP without any user involvement required. This is sort of true. Continue reading for the details.

These days Fedora installs chronyd by default, which is essentially a replacment for ntpd. It works with NTP servers (when you are lucky) and is recommended for machines without a permanent connection to the internet. If your machine is permanently connected to the internet, running ntpd may be a better choice.

Of the 4 machines I am now concerned with, all are running chronyd, but only one of the four is actually getting a time sync. Oddly enough, the machine where things are working is my machine at home on a cable network connection. The three machines where things are not working are all at the University. Perhaps firewall rules at the university edge combined with a choice of time servers is the root of the problem?

The find out if chronyd is doing what it should, use the following command:

[tom@dorado ~]$ chronyc tracking
Reference ID    : 00000000 ()
Stratum         : 0
Ref time (UTC)  : Thu Jan 01 00:00:00 1970
System time     : 0.000000012 seconds fast of NTP time
Last offset     : +0.000000000 seconds
RMS offset      : 0.000000000 seconds
Frequency       : 24.827 ppm fast
Residual freq   : +0.000 ppm
Skew            : 0.000 ppm
Root delay      : 1.000000000 seconds
Root dispersion : 1.000000000 seconds
Update interval : 0.0 seconds
Leap status     : Not synchronised
This machine is not working properly, and the key thing to note is the "Ref time" of January 1, 1970. The Stratum 0 is also a clue.

NTP servers

The chrony config file is /etc/chrony.conf. It ships with a single default server:
pool 2.fedora.pool.ntp.org iburst
This works on my home machine. The U of A provides NTP servers as follows:
0.pool.ntp.arizona.edu
1.pool.ntp.arizona.edu
A logical thing to try is to edit these servers into the chrony.conf file, restart the service and see if things get going. I put these lines into chrony.conf:
#pool 2.fedora.pool.ntp.org iburst
pool 0.pool.ntp.arizona.edu iburst
pool 1.pool.ntp.arizona.edu iburst
And I issue the command:
systemctl restart chronyd.service
And when I check things, I now see the following, so this is all that was needed.
chronyc tracking
Reference ID    : 80C48217 (birgegilbert.uits.arizona.edu)
Stratum         : 3
Ref time (UTC)  : Tue Apr 13 22:04:13 2021
System time     : 0.000114107 seconds slow of NTP time
Last offset     : -0.000122715 seconds
RMS offset      : 0.000130459 seconds
Frequency       : 10.757 ppm slow
Residual freq   : -0.086 ppm
Skew            : 0.926 ppm
Root delay      : 0.001433963 seconds
Root dispersion : 0.021883501 seconds
Update interval : 65.1 seconds
Leap status     : Normal
No doubt there is more that could be learned, but this satisfies me for now. I am feeling lazy and no need to fuss around getting ntp set up instead of chrony.


Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org