Timedatectl show-timesync with chrony

I’m using AlmaLinux 9.2 (Yes, I know that it’s already old, but it’s not entirely obsolete…)

I’ve got chronyd up and running, and it appears to be synchronizing the clock. (I used to have terrible clock drift, but not any more.)

Chrony looks happy:

]# systemctl status chronyd
● chronyd.service - NTP client/server
     Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; preset: enabled)
     Active: active (running) since Fri 2025-01-17 07:23:13 UTC; 56min ago
       Docs: man:chronyd(8)
             man:chrony.conf(5)
    Process: 56189 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 56192 (chronyd)
      Tasks: 1 (limit: 23212)
     Memory: 820.0K
        CPU: 198ms
     CGroup: /system.slice/chronyd.service
             └─56192 /usr/sbin/chronyd -F 2 -f /data/etc/chrony.conf

Jan 17 07:23:13 targa-01 systemd[1]: Starting NTP client/server...
Jan 17 07:23:13 targa-01 chronyd[56192]: chronyd version 4.3 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 +>
Jan 17 07:23:13 targa-01 chronyd[56192]: Frequency -25.582 +/- 0.004 ppm read from /var/lib/chrony/drift
Jan 17 07:23:13 targa-01 chronyd[56192]: Loaded seccomp filter (level 2)
Jan 17 07:23:13 targa-01 systemd[1]: Started NTP client/server.
Jan 17 07:23:20 targa-01 chronyd[56192]: Selected source 45.61.187.39 (0.pool.ntp.org)
Jan 17 08:05:22 targa-01 chronyd[56192]: Selected source 108.61.73.243 (2.pool.ntp.org)

And timedatectl agrees that the clock is synchronized:

# timedatectl status
               Local time: Fri 2025-01-17 08:20:38 UTC
           Universal time: Fri 2025-01-17 08:20:38 UTC
                 RTC time: Fri 2025-01-17 08:20:38
                Time zone: UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

However, the timedatectl show-timesync and timedatectl timesync-status claim that:

# timedatectl show-timesync
Failed to parse bus message: No route to host
# timedatectl timesync-status
Failed to query server: The name is not activatable

After some quick googling, it looks like timedatectl is trying to talk to timesyncd instead of chronyd, and this is not available.

Is this the desired behaviour? Is it possible to make timedatectl talk to chronyd?

timedatectl set-ntp yes and timedatectl set-ntp no correctly enables/disables chronyd, so it’s not entirely unaware of what’s going on.

man timedatectl writes:

systemd-timesyncd Commands
The following commands are specific to systemd-timesyncd.service(8).

timesync-status
Show current status of systemd-timesyncd.service(8). If --monitor is specified, then this will monitor the status updates.

show-timesync
Show the same information as timesync-status, but in machine readable form. This command is intended to be used whenever computer-parsable output is required. Use timesync-status if you are looking for formatted human-readable output.

By default, empty properties are suppressed. Use --all to show those too. To select specific properties to show, use --property=.

ntp-servers INTERFACE SERVER…
Set the interface specific NTP servers. This command can be used only when the interface is managed by systemd-networkd.

revert INTERFACE
Revert the interface specific NTP servers. This command can be used only when the interface is managed by systemd-networkd.

And the systemd-timesyncd is in EPEL:

systemd-timesyncd-253.4-1.el9.x86_64 : System daemon to synchronize local system clock with NTP server
Repo        : epel

That subset of timedatectl commands is only for that service, not for all sync services. I’d guess that the timesyncd gets special treatment because it is “part of SystemD”.

OK - I suppose it’s another of those ‘because it’s systemd’ issues. I was hoping that chrony would get some better treatment, as it is the default NTP for RHEL-like distros.

While the systemd-timesyncd is probably Good Enough™, it only implements SNTP, and not the full NTP protocol. It seems a bit backwards that you’d need to explicitly get timesyncd from EPEL if you want a less advanced version.

But I can live with that.

(I still think that the error messages from timedatectl are a bit misleading, though…)

Please don’t use 9.2, it is obsolete, you are missing out on all security updates released since 9.3. Can’t you upgrade to 9.5?

Yes, I’d like to upgrade to 9.5, but that may take some time to get through the CI.