You are not logged in.

#1 2022-09-16 14:18:55

Tid91
Member
Registered: 2013-12-01
Posts: 35
Website

[SOLVED] NTP not working using systemd-timesyncd

Hello, I'm trying to configure time synchronization using timedatectl on a Macbook Pro Mid 2010.

The `/etc/systemd/timesyncd.conf` is:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the timesyncd.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# See timesyncd.conf(5) for details.

[Time]
NTP=time.google.com
#NTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
#FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 0.fr.pool.ntp.org
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048
#ConnectionRetrySec=30
#SaveIntervalSec=60

Some other commands:

$ sudo timedatectl show-timesync --all

LinkNTPServers=
SystemNTPServers=time.google.com
RuntimeNTPServers=
FallbackNTPServers=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
ServerName=
ServerAddress=
RootDistanceMaxUSec=5s
PollIntervalMinUSec=32s
PollIntervalMaxUSec=34min 8s
PollIntervalUSec=0
Frequency=0

NTP has been activated using `timedatectl set-ntp true

❯ sudo timedatectl status
               Local time: Fri 2022-09-16 16:15:36 CEST
           Universal time: Fri 2022-09-16 14:15:36 UTC
                 RTC time: Fri 2022-09-16 14:15:36
                Time zone: Europe/Paris (CEST, +0200)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no
❯ sudo timedatectl timesync-status
       Server: n/a (n/a)
Poll interval: 0 (min: 32s; max 34min 8s)
 Packet count: 0

But system clock is still not synchronized.

Any idea on how I can investigate this?

Any idea on how to debug what's the problem with NTP?

Last edited by Tid91 (2022-09-16 14:27:44)

Offline

#2 2022-09-16 14:29:25

Tid91
Member
Registered: 2013-12-01
Posts: 35
Website

Re: [SOLVED] NTP not working using systemd-timesyncd

Replying to my own question: I was connected using a wlan0 interface configured with iwd, I had to set the corresponding configuration file in /etc/systemd/network/25-wireless.conf

[Match]
Name=wlan0

[Network]
DHCP=yes
IgnoreCarrierLoss=3s

After restarting systemd-networkd, timesyncd was able to contact time.google.com and sync time.

timedatectl status
               Local time: Fri 2022-09-16 16:29:07 CEST
           Universal time: Fri 2022-09-16 14:29:07 UTC
                 RTC time: Fri 2022-09-16 14:29:07
                Time zone: Europe/Paris (CEST, +0200)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Offline

Board footer

Powered by FluxBB