Bug 89676

Summary: systemd-timesyncd When no --with-ntp-servers is provided ntp doesn't work. [PATCH]
Product: systemd Reporter: Gianfranco <costamagnagianfranco>
Component: generalAssignee: systemd-bugs
Status: RESOLVED WORKSFORME QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: patch

Description Gianfranco 2015-03-19 13:36:53 UTC
Created attachment 114470 [details]
patch

Hi, as said in the title, I built systemd for yocto, without changing the default ntp configuration.

seems that time1.google.com doesnt' work, at least timesyncd keeps switching between google ntp servers with no luck.

changing to ntp pool fixes the issue.

Patch following
From 0cf1d11dee4af9fe515c18b115874ce5f229d69d Mon Sep 17 00:00:00 2001
From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Date: Thu, 19 Mar 2015 14:32:41 +0100
Subject: [PATCH] When no --with-ntp-servers is provided default to
 pool.ntp.org rather than on the non-working time.google.com

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 29111f5..8c6a7f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1051,7 +1051,7 @@ AC_ARG_WITH(ntp-servers,
         AS_HELP_STRING([--with-ntp-servers=NTPSERVERS],
                 [Space-separated list of default NTP servers]),
         [NTP_SERVERS="$withval"],
-        [NTP_SERVERS="time1.google.com time2.google.com time3.google.com time4.google.com"])
+        [NTP_SERVERS="pool.ntp.org 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org"])

 AC_DEFINE_UNQUOTED(NTP_SERVERS, ["$NTP_SERVERS"], [Default NTP Servers])
 AC_SUBST(NTP_SERVERS)
-- 
2.1.0
Comment 1 Zbigniew Jedrzejewski-Szmek 2015-03-21 19:51:32 UTC
Those google servers seem to work here. It might have been some network issue or other temporary problem.

IIRC, the problem was that the ntp pool does not want people to use their servers as default configuration. We thus default to google for now. Distributions are supposed to change this anyway.
Comment 2 Gianfranco 2015-03-23 14:43:27 UTC
I don't know, seems they aren't really working

Mar 23 13:43:16 systemd-timesyncd[315]: Using NTP server 216.239.32.15:123 (time1.google.com).
Mar 23 13:43:26 systemd-timesyncd[315]: Timed out waiting for reply from 216.239.32.15:123 (time1.google.com).
Mar 23 13:43:26 systemd-timesyncd[315]: Using NTP server [2001:4860:4802:32::f]:123 (time1.google.com).
Mar 23 13:43:26 systemd-timesyncd[315]: Using NTP server 216.239.34.15:123 (time2.google.com).
Mar 23 13:43:37 systemd-timesyncd[315]: Timed out waiting for reply from 216.239.34.15:123 (time2.google.com).
Mar 23 13:43:37 systemd-timesyncd[315]: Using NTP server [2001:4860:4802:34::f]:123 (time2.google.com).
Mar 23 13:43:37 systemd-timesyncd[315]: Using NTP server 216.239.36.15:123 (time3.google.com).

anyway, I'll keep the patch on my local machine then

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.