[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#37295] [PATCHv3] services: ntp: Support different NTP server types

From: Maxim Cournoyer
Subject: [bug#37295] [PATCHv3] services: ntp: Support different NTP server types and options.
Date: Tue, 03 Sep 2019 17:04:27 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Hello Efraim,

Efraim Flashner <address@hidden> 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.

Attachment: 0001-services-ntp-Support-different-NTP-server-types-and-.patch
Description: Text Data

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---
            (listen-on '("" "::1"))
            (sensor '("udcf0 correction 70000"))
            (constraint-from '(""))
            (constraints-from '("";))
            (allow-large-adjustment? #t)))
--8<---------------cut here---------------end--------------->8---

The following configuration file is generated:

--8<---------------cut here---------------start------------->8---
listen on
 listen on ::1
constraints from "";
constraints from "";
sensor udcf0 correction 70000
constraints from "";
constraints from "";
constraints from "";
constraint from
--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:

Thank you!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]