I have recently noticed that clock on my laptop is out of sync with the actual time by about 15 minutes.
I already made a reddit post and aioeu tried to help me, but we were not quite able to fix the issue.
what is known so far:
for some reason the chrony.conf configuration file did not contain the fedora time pool by default, it was only configured to use _gateway (DHCP afaik) to sync time which did not work
changing the config and rebooting does not synchronize time and chronyc sources still only shows _gateway as a source
running timedatectl returns System clock synchronized: no
my hardware clock is also out of sync (sudo hwclock)
here is the output from timedatectl:
Local time: Di 2024-02-06 11:00:20 CET
Universal time: Di 2024-02-06 10:00:20 UTC
RTC time: Di 2024-02-06 10:00:20
Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
and here is the output from chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^? _gateway 0 10 0 - +0ns[ +0ns] +/- 0ns
lastly, here is my (edited) chrony.conf file:
config
# These servers were defined in the installation:
server _gateway iburst
# server 0.de.pool.ntp.org
# server 1.de.pool.ntp.org
# server 2.de.pool.ntp.org
# server 3.de.pool.ntp.org
pool 2.fedora.pool.ntp.org iburst
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (https://www.pool.ntp.org/join.html).
# Use NTP servers from DHCP.
sourcedir /run/chrony-dhcp
# 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
# Require authentication (nts or key option) for all NTP sources.
#authselectmode require
# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys
# Save NTS keys and cookies.
ntsdumpdir /var/lib/chrony
# Insert/delete leap seconds by slewing instead of stepping.
#leapsecmode slew
# 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
It can’t reach a time server called _gateway. you need a valid IP or URL there.
fix the conf file first. then reload the service.
here is how my /etc/chrony.conf looks like
cat /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (https://www.pool.ntp.org/join.html).
pool 2.fedora.pool.ntp.org iburst
# Use NTP servers from DHCP.
sourcedir /run/chrony-dhcp
# 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
# Require authentication (nts or key option) for all NTP sources.
#authselectmode require
# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys
# Save NTS keys and cookies.
ntsdumpdir /var/lib/chrony
# Insert/delete leap seconds by slewing instead of stepping.
#leapsecmode slew
# 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
make it look like
# server _gateway iburst
server 0.de.pool.ntp.org iburst
server ptbtime1.ptb.de iburst
server 1.de.pool.ntp.org iburst
server ptbtime4.ptb.de iburst
You probably don’t want to run both chronyd and systemd-timesyncd as they will both be trying to synchronise the clock - you probably want to stick to one or the other.
From what I remember, systemd-timesyncd is not enabled by default in Fedora.
On a pretty virgin VM that I run, I see that service is disabled. Also, neither /etc/systemd/timesyncd.conf nor /etc/systemd/networkd.conf provide NTP servers.
I edited my post above since I confused chronyd and timesyncd but they are clearly two different services.
timedatectl set-local-rtc 0 to set the UEFI/BIOS time to UTC timedatectl set-ntp true to enable NTP
After these, chronyd and other software and games started working correctly again.
It baffles me why these are not configured by default in an OOTB configuration for Fedora 40
EDIT: I take it back, I constantly get errors:
may 04 18:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
may 04 20:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
may 04 22:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
may 05 00:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
may 05 02:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
may 05 04:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
may 05 06:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
may 05 08:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
may 05 10:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
may 05 12:43:10 fedora chronyd[1431]: Could not add source 192.168.4.1 : Already in use
I always set the RTC to UTC within the bios setup screens.
I then use the system settings panel to set the time zone which converts time displayed to local.
I normally only use timedatectl to confirm the settings are correct.
I’m using the KDE spin, so it might have to do something with that.
Here’s what finally fixed my settings:
Edit the first lines of /etc/chrony.conf:
# These servers were defined in the installation:
#server _gateway iburst
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (https://www.pool.ntp.org/join.html).
server 0.fedora.pool.ntp.org iburst
server 1.fedora.pool.ntp.org iburst
server 2.fedora.pool.ntp.org iburst
server 3.fedora.pool.ntp.org iburst
On openSUSE TW I noticed that their online time sync only applies to the OS and doesn’t immediately kick-in after a reboot. I do CMOS resets and my BIOS time is always off on fresh installs.
After doing an online time sync, I run sudo hwclock --systohc to save it to BIOS and that’s solved pretty easily.
I don’t know what Fedora does, but I never had it be an issue post-install, but seen some time flips during installing in the LiveUSB environment.
During initial setup with first boot the user selects the time zone. It is expected that the RTC in bios is already set to UTC. Until the local time zone is properly set fedora by default uses EST (New York, USA) and setting the time zone then changes it to local.