Linux – NTP time sync failures on Debian

debianlinuxntpunix

This is on HypriotOS (Debian GNU/Linux 10) running on RaPi.

$ timedatectl show-timesync
Failed to parse bus message: Connection timed out

Then do this with sudo:

$ sudo timedatectl timesync-status
Failed to query server: Failed to activate service 'org.freedesktop.timesync1': timed out (service_start_timeout=25000ms)

Then showing the timedatectl status reveals that "NTP service: inactive"

$ timedatectl status
               Local time: Sat 2020-03-07 21:03:51 CET
           Universal time: Sat 2020-03-07 20:03:51 UTC
                 RTC time: n/a
                Time zone: Europe/Zurich (CET, +0100)
System clock synchronized: yes
              NTP service: inactive
          RTC in local TZ: no

What is the proper way to fix this? Or first maybe, from where to pull information for analysis?

I already set the correct NTP servers in /etc/systemd/timesyncd.conf and then ran $ sudo timedatectl set-ntp false followed by $ sudo timedatectl set-ntp true.

Update 2020-03-23

Restarting timesyncd as proposed doesn't work – it ain't there.

$ systemctl restart timesyncd
Failed to restart timesyncd.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status timesyncd.service' for details.
$ sudo systemctl restart timesyncd
Failed to restart timesyncd.service: Unit timesyncd.service not found.
$ systemctl status timesyncd.service
Unit timesyncd.service could not be found.

Best Answer

As of Ubuntu Server Guide for NTP (Ubuntu is based in Debian), there exist a service integrated in systemd for processing the time synchronization. Maybe it need to be restarted to apply your changes:

systemctl restart timesyncd

or, if you wanted a full NTP server, you could install chrony as recommended, or ntpd as the traditional NTP daemon (an user installed NTP server will have priority over timesyncd).