You are not logged in.

#1 2018-04-27 09:41:19

beardedlinuxgeek
Member
Registered: 2012-09-17
Posts: 32
Website

[Solved] What server does systemd-timesyncd connect to?

While reading the Laptop page today, I saw the section on network time sync and remembered that I don't have NTP installed. I've been using timedatectl.

    $ timedatectl status
                          Local time: Fr 2018-04-27 11:18:17 CEST
                      Universal time: Fr 2018-04-27 09:18:17 UTC
                            RTC time: Fr 2018-04-27 09:18:17
                           Time zone: Europe/Berlin (CEST, +0200)
           System clock synchronized: yes
    systemd-timesyncd.service active: yes
                     RTC in local TZ: no

I checked https://time.is and my clock is off by 0.019 seconds (pretty good), so the clock must be syncing over the network. I have systemd-timesyncd.service enabled and from the wiki:

In contrast to NTP implementations such as chrony or the NTP reference server this only implements a client side, and does not bother with the full NTP complexity, focusing only on querying time from one remote server and synchronizing the local clock to it.

Yup, all sounds good to me. I open up /etc/systemd/timesyncd.conf and everything is commented out, no servers there.

    [Time]
    #NTP=
    #FallbackNTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
    #RootDistanceMaxSec=5
    #PollIntervalMinSec=32
    #PollIntervalMaxSec=2048

I check the service files, nothing in there. As you can see from the status output above, it doesn't say Network time on: yes or NTP synchronized: yes like in the wiki, so NTP is not enabled.

I see at the bottom of the wiki

NTP servers may also be provided via a systemd-networkd configuration

But I don't have any NTP servers set in systemd-networkd conf and I'm not even using systemd-networkd (I use NetworkManager).

So where the heck is the time coming from? Are the default servers in timesyncd.conf also hardcoded into the binary? Is there some interaction with NetworkManager to get the time from the router?

Last edited by beardedlinuxgeek (2018-04-27 10:33:55)

Offline

#2 2018-04-27 09:44:39

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [Solved] What server does systemd-timesyncd connect to?

https://git.archlinux.org/svntogit/pack … ed70a#n144
Edit:

man timesyncd.conf wrote:

CONFIGURATION DIRECTORIES AND PRECEDENCE
       The default configuration is defined during compilation, so a
       configuration file is only needed when it is necessary to deviate from
       those defaults. By default, the configuration file in /etc/systemd/
       contains commented out entries showing the defaults as a guide to the
       administrator. This file can be edited to create local overrides.

Last edited by loqs (2018-04-27 09:51:42)

Offline

#3 2018-04-27 10:34:11

beardedlinuxgeek
Member
Registered: 2012-09-17
Posts: 32
Website

Re: [Solved] What server does systemd-timesyncd connect to?

Exactly what I was looking for. Thank you.

Offline

Board footer

Powered by FluxBB