Skip to contentSkip to conversation

systemd-conf: add timesyncd.conf

PATCH In review Cengiz Can 4 participants 7 messages Nov 26, 2019 – Nov 28, 2019

lore
Share & tools
lore

Cengiz Can

author
#0 lore raw

PATCH 1/1 systemd-conf: add timesyncd.conf

Currently OE-Core's systemd-timesyncd defaults to Google's time servers.

However those servers are not always reachable.

```
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.12:123 (time4.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.0:123 (time1.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.4:123 (time2.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.8:123 (time3.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.12:123 (time4.google.com).
```

Even if they are, it is much more sensible to use pool servers from ntp.org.

This patch adds a default timesyncd.conf with Google's time servers moved to Fallback and pool.ntp.org as primary time servers.

---
 .../systemd/systemd-conf/timesyncd.conf         | 17 +++++++++++++++++
 meta/recipes-core/systemd/systemd-conf_243.bb   |  3 +++
 2 files changed, 20 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd-conf/timesyncd.conf
meta/recipes-core/systemd/systemd-conf/timesyncd.conf new file +17 -0
new file mode 100644
index 0000000000..84fdc354b8
@@ -0,0 +1,17 @@
+#  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.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
+#
+# See timesyncd.conf(5) for details.
+
+[Time]
+NTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
+FallbackNTP=time1.google.com time2.google.com time3.google.com time4.google.com
+
meta/recipes-core/systemd/systemd-conf_243.bb +3 -0
index d9ec023bfd..238bca9373 100644
@@ -11,6 +11,7 @@ SRC_URI = "\
     file://system.conf \
     file://system.conf-qemuall \
     file://wired.network \
+    file://timesyncd.conf \
 "
 
 do_install() {
@@ -18,6 +19,7 @@ do_install() {
 	install -D -m0644 ${WORKDIR}/logind.conf ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
 	install -D -m0644 ${WORKDIR}/system.conf ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
 	install -D -m0644 ${WORKDIR}/wired.network ${D}${systemd_unitdir}/network/80-wired.network
+	install -D -m0644 ${WORKDIR}/timesyncd.conf ${D}${sysconfdir}/systemd/timesyncd.conf
 }
 
 # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
@@ -35,4 +37,5 @@ FILES_${PN} = "\
     ${systemd_unitdir}/logind.conf.d/ \
     ${systemd_unitdir}/system.conf.d/ \
     ${systemd_unitdir}/network/ \
+    ${sysconfdir}/systemd/timesyncd.conf \
 "
Signature · 1 line
2.24.0
#1 lore raw
Quoted 43 lines · Cengiz Can

Currently OE-Core's systemd-timesyncd defaults to Google's time servers.

However those servers are not always reachable.

```
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.12:123 (time4.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.0:123 (time1.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.4:123 (time2.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.8:123 (time3.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.12:123 (time4.google.com).
```

Even if they are, it is much more sensible to use pool servers from ntp.org.

This patch adds a default timesyncd.conf with Google's time servers moved to Fallback and pool.ntp.org as primary time servers.

---
 .../systemd/systemd-conf/timesyncd.conf         | 17 +++++++++++++++++
 meta/recipes-core/systemd/systemd-conf_243.bb   |  3 +++
 2 files changed, 20 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd-conf/timesyncd.conf
meta/recipes-core/systemd/systemd-conf/timesyncd.conf new file +4 -0
new file mode 100644
index 0000000000..84fdc354b8
@@ -0,0 +1,17 @@
+#  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

meta/recipes-core/systemd/systemd-conf/timesyncd.conf new file +1 -0
+#  the Free Software Foundation; either version 2.1 of the License, or

meta/recipes-core/systemd/systemd-conf/timesyncd.conf line 15

Quoted 10 lines
meta/recipes-core/systemd/systemd-conf/timesyncd.conf new file +10 -0
+#  (at your option) any later version.
+#
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
+#
+# See timesyncd.conf(5) for details.
+
+[Time]
+NTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org

https://www.ntppool.org/en/vendors.html should be considered before changing the defaults to these values. We should probably get a vendor zone.

Signature · 1 line
Paul Barker
#2 lore raw
In reply to Cengiz Can
Quoted 23 lines · Cengiz Can

Currently OE-Core's systemd-timesyncd defaults to Google's time servers.

However those servers are not always reachable.

```
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.12:123
(time4.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.0:123
(time1.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.4:123
(time2.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.8:123
(time3.google.com).
systemd-timesyncd[242]:
  Timed out waiting for reply from 216.239.35.12:123
(time4.google.com).
```
Quoted 6 lines

Even if they are, it is much more sensible to use pool servers from ntp.org.

This patch adds a default timesyncd.conf with Google's time servers moved to Fallback and pool.ntp.org as primary time servers.

if we want to make this change then we should also let users know about any restrictions on its use will be imposed by moving to new servers, my suggestion would be to stay with defaults as it is, and have bbappends in own layers to point to time servers suitable for your projects.

Quoted 72 lines
---
 .../systemd/systemd-conf/timesyncd.conf         | 17
+++++++++++++++++
 meta/recipes-core/systemd/systemd-conf_243.bb   |  3 +++
 2 files changed, 20 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd-

conf/timesyncd.conf

meta/recipes-core/systemd/systemd-conf/timesyncd.conf new file +3 -0
new file mode 100644
index 0000000000..84fdc354b8
@@ -0,0 +1,17 @@
+#  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

meta/recipes-core/systemd/systemd-conf/timesyncd.conf new file +11 -0
+#  (at your option) any later version.
+#
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
+#
+# See timesyncd.conf(5) for details.
+
+[Time]
+NTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
+FallbackNTP=time1.google.com time2.google.com time3.google.com

time4.google.com

meta/recipes-core/systemd/systemd-conf/timesyncd.conf new file +1 -0
+
meta/recipes-core/systemd/systemd-conf_243.bb +1 -0
index d9ec023bfd..238bca9373 100644
@@ -11,6 +11,7 @@ SRC_URI = "\
     file://system.conf \
     file://system.conf-qemuall \
     file://wired.network \
+    file://timesyncd.conf \
 "
 
 do_install() {
@@ -18,6 +19,7 @@ do_install() {
 	install -D -m0644 ${WORKDIR}/logind.conf

${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
install -D -m0644 ${WORKDIR}/system.conf
${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
install -D -m0644 ${WORKDIR}/wired.network
${D}${systemd_unitdir}/network/80-wired.network

meta/recipes-core/systemd/systemd-conf_243.bb +1 -0
+	install -D -m0644 ${WORKDIR}/timesyncd.conf

${D}${sysconfdir}/systemd/timesyncd.conf
}

# Based on change from YP bug 8141, OE commit
5196d7bacaef1076c361adaa2867be31759c1b52

meta/recipes-core/systemd/systemd-conf_243.bb +1 -0
@@ -35,4 +37,5 @@ FILES_${PN} = "\
     ${systemd_unitdir}/logind.conf.d/ \
     ${systemd_unitdir}/system.conf.d/ \
     ${systemd_unitdir}/network/ \
+    ${sysconfdir}/systemd/timesyncd.conf \
 "
Signature · 1 line
2.24.0
#3 lore raw
In reply to Cengiz Can
Quoted 2 lines · Cengiz Can

This patch adds a default timesyncd.conf with Google's time servers moved to Fallback and pool.ntp.org as primary time servers.

The "advice for vendors" on the ntp.org website specifically says:

Do not use the standard pool.ntp.org names as a default configuration in your system.

I don't think we should make this change.

p.

author
#4 lore raw

Hello,

I didn't know that they were using vendor naming for rate limiting.

Quoted 8 lines · On November 26, 2019 21:19:31 Phil Blundell <[email protected]> wrote:

The "advice for vendors" on the ntp.org website specifically says:

Do not use the standard pool.ntp.org names as a default configuration in your system.

I don't think we should make this change.

I have two questions though

1) Does Google allow their time servers to be directly used?

2) Can we apply for a vendor name like "oe" so at least they can throttle/rate limit their inbound traffic?

Because at current state, timesyncd is unreliable and doesn't have sane defaults enabled. pool.ntp.org is a community effort but has thousands of servers that are available for service. Not just 4 Google controlled servers.

#5 lore raw
Quoted 1 line · Cengiz Can

1) Does Google allow their time servers to be directly used?

I believe so. I couldn't immediately find anything on their website that said differently.

Quoted 2 lines

2) Can we apply for a vendor name like "oe" so at least they can throttle/rate limit their inbound traffic?

I guess the OpenEmbedded corporate entity could apply for one. I don't actually know what the current organisation is; the website just says "OpenEmbedded is a Texas-registered company. More details to follow."

Mostly though I think this is a distro configuration issue and ought to be addressed there.

Quoted 4 lines

Because at current state, timesyncd is unreliable and doesn't have sane defaults enabled. pool.ntp.org is a community effort but has thousands of servers that are available for service. Not just 4 Google controlled servers.

I'm fairly sure that time.google.com has more than four servers (they are load-balanced behind a single public IP, just like the Google nameserver 8.8.4.4 is not a single machine either). It's not completely obvious to me that pool.ntp.org is generally more available.

The Google servers also do leap smearing which might or might not be a good thing depending on your point of view. I'm not sure whether the pool.ntp.org ones do the same thing or not.

p.

author
#6 lore raw
Quoted 3 lines · Phil Blundell

I believe so. I couldn't immediately find anything on their website that
said differently.

Ok. I've found it here: https://developers.google.com/time/faq

Quoted 3 lines

The Google servers also do leap smearing which might or might not be a good thing depending on your point of view. I'm not sure whether the pool.ntp.org ones do the same thing or not.

ntp.org's Discourse forum has posts mentioning that leap smearing is not supported and Google specific only.

How often those leap seconds occur is out of my knowledge and expertise.

So I guess I'm giving up on this and let distro bakers decide on what to use.

Thanks everyone.

Cengiz Can
@cengiz_io