0

When running timedatectl to check if my system clock has been synchronized via NTP I get the following:

~> timedatectl
Failed to query server: The name org.freedesktop.timedate1 was not provided by any .service files

systemd-timedated.service has ran.

~> systemctl status systemd-timedated.service
● systemd-timedated.service - Time & Date Service
     Loaded: loaded (/usr/lib/systemd/system/systemd-timedated.service; static; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-timedated.service(8)
             man:localtime(5)
             https://www.freedesktop.org/wiki/Software/systemd/timedated

Mar 23 14:28:16 cm1sd systemd[1]: Starting Time & Date Service...
Mar 23 14:28:16 cm1sd systemd[1]: Started Time & Date Service.
Mar 23 14:29:00 cm1sd systemd[1]: systemd-timedated.service: Succeeded.

Looking online I haven't found anything talking about this error message. How can I use systemd and timedatectl to have my system clock synchronized with an NTP server? I've also noted nothing under /etc/systemd/ defines the NTP server to use. I'm on an embedded Linux system, built using Buildroot, systemd version 244.5.

dangeroushobo
  • 537
  • 3
  • 11
  • 24

2 Answers2

0

If you are using Active Directory / Centrify, you can try to reboot the server. That is what they suggested us do and it worked for us. However, it is unclear what the underlying cause is to me, nor is it very satisfying if it is a shared server where you can't just reboot it willy-nilly.

0

systemd-timedated is a service that uses D-Bus to communicate with its clients, like the timedatectl command. The systemctl cat systemd-timedated.service should include BusName=org.freedesktop.timedate1, which will tell systemd how to monitor this service, assign it Type=dbus, and make it dependent on the dbus.socket unit. It also allows systemd to start the service "on-demand" whenever anything makes a request for it on the system D-Bus.

The error message suggests that either systemd was not able to start systemd-timedated when timedatectl called for it, or that there is some kind of a problem with the system D-Bus.

systemd-timedated is essentially just a unified "front-end" to setting the system clock, default timezone & starting/stopping the actual clock synchronization services, like chronyd.service, systemd-timesyncd.service or ntp.service. You can actually define the order of preference in which systemd-timedated seaches for the actual synchronization services, either by defining an environment variable in an override file, e.g.:

[Service]
Environment=SYSTEMD_TIMEDATED_NTP_SERVICES=chronyd.service:ntp.service:systemd-timesyncd.service

You will still have to configure the NTP server to use by using the configuration files of whichever actual NTP service you end up using, or have to configure the NTP services to get the NTP server address from the DHCP response, if applicable. systemd-timesyncd does this automatically if you use systemd-networkd to configure your NICs; otherwise you may need to configure your DHCP client to request a NTP server address and to stash that information somewhere in a form that's useful to NTP service(s).

In an embedded system, I think minimizing the system D-Bus can be a valid choice, depending on what the system is for. Eliminating non-essential front-end services like systemd-timedated and relying on classic command line tools could be a part of it. So, are you sure systemd-timedated should be working?

telcoM
  • 87,318
  • 3
  • 112
  • 232