blog.tnez.dev

Syncing System Clock in Arch Linux

Problem

I noticed my system clock was drifting quite a bit (in to the future) from the time I observed on my phone and other clocks. This is a known limitation of all software clocks. It is most often resolved by having the clock periodically reset to a trusted time so that the drift isn't allowed to take the time too far off course.

Most of the time your operating system does this for you, but I had not yet set anything up in Arch.

Not surprisingly I found relevant info on the Arch Wiki. I verified that my time was not currently being synchronized by running timedatectl which as part of its output read:

System clock synchronized: no
NTP service: inactive

Solution

As prescribed in the Wiki I uncommented the relevant lines in /etc/systemd/timesyncd.conf so that to become:

[Time]
NTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
RootDistanceMaxSec=5
PollIntervalMinSec=32
PollIntervalMaxSec=2048

And then restarted the daemon with systemctl restart systemd-timesyncd and then verified the output of timedatectl which now read:

System clock synchronized: yes
NTP service: active

Bonus

I also went ahead and installed tzupdate which automatically updates the timezone using my IP address: yay tzupdate

← Back to Home