4

I'm having troubles on a Debian 8 installation to get systemd to synchronise time properly. NTP has been enabled with timedatectl set-ntp true and systemctl status systemd-timesyncd reports:

● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled)
   Active: active (running) since Thu 2016-02-04 13:25:22 CET; 5h 49min ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 302 (systemd-timesyn)
   Status: "Idle."
   CGroup: /system.slice/systemd-timesyncd.service
           └─302 /lib/systemd/systemd-timesyncd

No errors can be found in any logs, though timesyncd still seem to refuse to synchronise properly, as timedatectl status reports:

NTP enabled: yes
NTP synchronized: no

Time-section (the only section) from timesyncd.conf:

[Time]
Servers=0.dk.pool.ntp.org 1.dk.pool.ntp.org 2.dk.pool.ntp.org 3.dk.pool.ntp.org 
#Servers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org

Finally running ntpdate manually against one of the servers in the configuration, ntpdate 0.dk.pool.ntp.org, synchronises just fine.

May it be so that there's an error somewhere on my behalf, but if so, shouldn't timesyncd or systemd report this?

4
  • Do you have a /etc/systemd/timesyncd.conf file? If so, post the contents of that file in the question. If not, that's probably the issue.
    – Munir
    Feb 5, 2016 at 0:54
  • Configuration from /etc/systemd/timesyncd.conf added to the question.
    – blockdev
    Feb 5, 2016 at 9:08
  • is your system able to reach the NTP pool servers over NTP? "ntpq -c peers" would be one test
    – Jeff Schaller
    Feb 5, 2016 at 15:44
  • Also, check if ntpd service is running with systemctl status systemd-timesyncd ntpd. You should see ntpd service active and running. If not, you'll have to enable ntpd service with sudo systemctl enable ntpd.
    – Munir
    Feb 5, 2016 at 18:25

1 Answer 1

3

Most likely your access to the time servers specified are blocked via firewall/network or your local host-based firewall (iptables). I got the same errors on Debian Jessie 8.6 such as below:

systemd-timesyncd[21869]: Using NTP server 193.225.118.163:123     (hu.pool.ntp.org). 2016-12-27T11:57:24.832779+01:00 xxxxxx systemd-timesyncd[21869]:     Timed out waiting for reply from 193.225.118.163:123 (hu.pool.ntp.org).

Note that the command systemctl status systemd-timesyncd should show the same or similar output to you on your terminal. If not, try restarting the service and look out for Timed out waiting for reply from ... . If you have successful connection to the NTP server, the service logs should show you the following after restarting the service:

Dec 27 11:58:14 xxxxx systemd[1]: Started Network Time Synchronization.
Dec 27 11:58:14 xxxxx systemd-timesyncd[21895]: Using NTP server X.Y.Z.ZZ:123 (your.ntp-server.com).

After this, the command timedatectl status should display the line (among others):

...
NTP enabled: yes
NTP synchronized: yes
...

Note that you don't have to have anything specified in the relevant section of /etc/systemd/timesyncd.conf . If you commented out the Servers line, then the the service defaults to 0-3.debian.pool.ntp.org time servers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .