Some pointers concerning systemd-timesyncd.service
that comes default with Pi-OS/Raspbian.
You already figured out to list the systemd
logs:
journalctl --full --no-pager -u systemd-timesyncd.service
Below one shows time/date and if NTP is active and syncing:
pi@ph5b:~ $ timedatectl
Local time: Fri 2022-06-10 19:35:14 CEST
Universal time: Fri 2022-06-10 17:35:14 UTC
RTC time: n/a
Time zone: Europe/Amsterdam (CEST, +0200)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Below one shows details about the syncing:
pi@ph5b:~ $ timedatectl timesync-status
Server: 185.216.161.42 (0.debian.pool.ntp.org)
Poll interval: 34min 8s (min: 32s; max 34min 8s)
Leap: normal
Version: 4
Stratum: 1
Reference: GPS
Precision: 2us (-19)
Root distance: 45us (max: 5s)
Offset: -2.118ms
Delay: 17.115ms
Jitter: 2.938ms
Packet count: 2654
Frequency: -17.507ppm
Am not sure but from above it looks like systemd-timesyncd
is suppose to poll every 34 minutes when successful and goes down to 32 seconds when it fails syncing.
Maybe someone else can confirm or debunk?
Or if you want to monitor:
timedatectl --monitor timesync-status
If install ntpdate
:
pi@ph5b:~ $ sudo apt install ntpdate
[..]
After this operation, 234 kB of additional disk space will be used.
You can manually test connectivity with NTP server IP's or DNS pool names:
pi@ph5b:~ $ ntpdate -q 0.debian.pool.ntp.org
server 162.159.200.123, stratum 3, offset -0.004728, delay 0.05746
server 45.85.15.35, stratum 2, offset -0.002805, delay 0.03673
server 5.79.108.34, stratum 2, offset -0.003996, delay 0.03769
server 188.165.11.86, stratum 2, offset -0.004380, delay 0.04564
10 Jun 19:46:18 ntpdate[6372]: adjust time server 45.85.15.35 offset -0.002805 sec
Above is also a good test to see if the 0.debian.pool.ntp.org
name resolves to IP's properly on the host itself (IP's in the pool are a bit dynamic):
pi@ph5b:~ $ dig +short 0.debian.pool.ntp.org a
188.165.11.86
162.159.200.123
45.85.15.35
5.79.108.34