centos8 – CentOS 8 NTP: Chrony will not Sync with sources, timedatectl showing no sync but NTP active

I have been battling with Chrony for the last few hours and cannot seem to figure out what I’m doing wrong.
I found that my system time was set to 2015 when trying to activate Epel-release in DNF, some certificate errors lead me to trying to resolve time date issues. Below is all my relevant output:

    # timedatectl
               Local time: Wed 2021-05-05 16:24:27 EDT
           Universal time: Wed 2021-05-05 20:24:27 UTC
                 RTC time: Wed 2021-05-05 20:24:27
                Time zone: America/Detroit (EDT, -0400)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

I had to set time manually, so this is actually one minute fast so that I could see if it ran correctly.

# chronyc sources
210 Number of sources = 4
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^? ntp.speculation.org           0   9     0     -     +0ns(   +0ns) +/-    0ns
^? c-73-239-136-185.hsd1.wa>     0   9     0     -     +0ns(   +0ns) +/-    0ns
^? 165.227.106.11                0   9     0     -     +0ns(   +0ns) +/-    0ns
^? x.ns.gin.ntt.net              0   9     0     -     +0ns(   +0ns) +/-    0ns

# chronyc activity
200 OK
5 sources online
0 sources offline
0 sources doing burst (return to online)
0 sources doing burst (return to offline)
0 sources with unknown address

Looking at other people’s sources output this seems not only unrealistic, but just wrong

# systemctl stop chronyd

# chronyd -q
2021-05-05T20:31:16Z chronyd version 3.5 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
2021-05-05T20:31:16Z Frequency -97.480 +/- 1.274 ppm read from /var/lib/chrony/drift
2021-05-05T20:31:16Z Using right/UTC timezone to obtain leap second data
2021-05-05T20:31:27Z No suitable source for synchronisation
2021-05-05T20:31:27Z chronyd exiting

I’m not even sure where to start troubleshooting this, I have tried with and without firewalld running.

# cat /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
server 2.pool.ntp.org iburst
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3

# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *

# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2

# Allow NTP client access from local network.
#allow 192.168.0.0/16

# Serve time even if not synchronized to a time source.
#local stratum 10

# Specify file containing keys for NTP authentication.
keyfile /etc/chrony.keys

# Get TAI-UTC offset and leap seconds from the system tz database.
leapsectz right/UTC

# Specify directory for log files.
logdir /var/log/chrony

# Select which information is logged.
#log measurements statistics tracking

I have edited my conf files a ton, my pools might be a little weird but I wasn’t sure what else to have them set to. before this there was just 1 pool directive that I foolishly removed without backing up.

# ntpstat
unsynchronised
poll interval unknown

Finally by suggestion of a friend, I used ntpstat and it gave me this output..

I have tried chronyc makestep and refresh, both of which have yielding nothing as well

chrony time server not synchronised

My chrony time server can get the time from another internal time server but not from time servers on the Internet:

chronyc sources
210 Number of sources = 9
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^? ptbtime1.ptb.de               0   7     0     -     +0ns(   +0ns) +/-    0ns
^? static.133.158.47.78.cli>     0   7     0     -     +0ns(   +0ns) +/-    0ns
^? alpha.rueckgr.at              0   7     0     -     +0ns(   +0ns) +/-    0ns
^? stratum2-2.NTP.TechFak.N>     0   7     0     -     +0ns(   +0ns) +/-    0ns
^? totoro.ax86.net               0   7     0     -     +0ns(   +0ns) +/-    0ns
^? 195.50.171.101                0   7     0     -     +0ns(   +0ns) +/-    0ns
^? 82.165.77.164                 0   7     0     -     +0ns(   +0ns) +/-    0ns
^? 79.133.44.136                 0   7     0     -     +0ns(   +0ns) +/-    0ns
^? ntp1.radio-sunshine.org       0   7     0     -     +0ns(   +0ns) +/-    0ns


chronyc tracking
Reference ID    : 00000000 ()
Stratum         : 0
Ref time (UTC)  : Thu Jan 01 00:00:00 1970
System time     : 0.000000009 seconds fast of NTP time
Last offset     : +0.000000000 seconds
RMS offset      : 0.000000000 seconds
Frequency       : 0.379 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


nc -zvu ptbtime1.ptb.de 123
Connection to ptbtime1.ptb.de 123 port (udp/ntp) succeeded!

I would be very happy to receive tips that would lead to problem solving.

linux – gpsd.socket for chrony does not work

I tried using the ublox module and Centos to get more accurate time from the GPS data, but it seems gpsd.sock does not work properly to chronize the data.

Do I miss something?

(root@info /)# cat /etc/chrony.conf 
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

allow

refclock SOCK /var/run/chrony.ttyS0.sock delay 0.5 refid GPS
refclock PPS /dev/pps0 lock NMEA refid PPS prefer trust

and there is no issue in the chronic sources "GPS"

(root@info /)# chronyc sources 
210 Number of sources = 6
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
#? GPS                           0   4     0     -     +0ns(   +0ns) +/-    0ns
#* PPS                           0   4     0   311   -382ns( -613ns) +/-  538ns
^- 162.159.200.1                 3   8   173    17  +8684us(+8684us) +/-   71ms
(root@info /)# cat /lib/systemd/system/gpsd.socket 
(Unit)
Description=GPS (Global Positioning System) Daemon Sockets

(Socket)
ListenStream=/var/run/gpsd.sock
ListenStream=0.0.0.0:2947
#SocketMode=0600
SocketMode=0755

(Unit)
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
# Needed with chrony SOCK refclock
After=chronyd.service


(Install)
Also=gpsd.socket
WantedBy=sockets.target
(root@info /)# cat /etc/systemd/system/multi-user.target.wants/gpsd.service
(Unit)
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
# Needed with chrony SOCK refclock
After=chronyd.service

(Service)
EnvironmentFile=-/etc/sysconfig/gpsd
ExecStart=/usr/sbin/gpsd -N -G $OPTIONS $DEVICES

(Install)
WantedBy=multi-user.target
Also=gpsd.socket

Linux – In Centos 7 there is no NTPD. How do I synchronize the time automatically and manually with chrony?

Unless you have changed the configuration of chrony, all you have to do is start the service.

systemctl enable --now chronyd.service

The default configuration automatically sets the time at startup (with the key make step Directive) if it deviates more than one second from the standard NTP servers.


If you explicitly removed make step In the configuration you can set the clock step by step with the command

Chronological Makestep

You should NOT Do this if you have used the non-default setting rtcfile Option, as it incorrectly records RTC drift.


For more details, see the RHEL 7 Chrony documentation.