GNU bug report logs - #37295
[PATCH] services: ntp: Support different NTP server types and options.

Previous Next

Package: guix-patches;

Reported by: maxim.cournoyer <at> gmail.com

Date: Tue, 3 Sep 2019 12:23:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 37295 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 37295 <at> debbugs.gnu.org
Subject: Re: [bug#37295] [PATCHv3] services: ntp: Support different NTP server
 types and options.
Date: Tue, 03 Sep 2019 17:04:27 +0900
[Message part 1 (text/plain, inline)]
Hello Efraim,

Efraim Flashner <efraim <at> flashner.co.il> writes:

> Can you check how this affects the openntpd service? It currently also
> uses %ntp-servers

I had overlooked this important detail; thanks for pointing it out!

I made the simplest change possible, by introducing a %openntpd-servers
variable that holds a list of addresses (strings), which is defined as
(map ntp-server-address %ntp-servers).  This variable is used as the new
default value for the "servers" field of the openntpd-configuration
record.  See the attached patch for details.

[0001-services-ntp-Support-different-NTP-server-types-and-.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
We could also overhaul the code of the openntpd-service-type so that it'd
be possible to provide different server types and options like for the
'ntp-service-type', but I'm not sure it's worth it, given that OpenNTPD
is more spartan than NTP (it only supports two server types ('server' vs
'servers'), already captured as fields in its configuration record; and
its server directives only support one option, 'weight', which can
currently be included in the server string if desired).

However, I noticed that the configuration file produced by the openntpd
service, while valid, is not very clean.

For the documented following openntpd-service-type definition:

--8<---------------cut here---------------start------------->8---
(openntpd-configuration
            (listen-on '("127.0.0.1" "::1"))
            (sensor '("udcf0 correction 70000"))
            (constraint-from '("www.gnu.org"))
            (constraints-from '("https://www.google.com/"))
            (allow-large-adjustment? #t)))
--8<---------------cut here---------------end--------------->8---

The following configuration file is generated:

--8<---------------cut here---------------start------------->8---
listen on 127.0.0.1
 listen on ::1
constraints from "https://www.google.com/"
constraints from "https://www.google.com/"
sensor udcf0 correction 70000
constraints from "https://www.google.com/"
constraints from "https://www.google.com/"
servers 0.guix.pool.ntp.org
constraints from "https://www.google.com/"
constraint from www.gnu.org
--8<---------------cut here---------------end--------------->8---

This is reproducible when testing without my changes (with the difference
that multiple servers were used instead of a single "pool" entry point).

I've opened an issue so that this issue can be tracked separately here:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=37318.

Thank you!

Maxim

This bug report was last modified 5 years and 252 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.