Re: [chrony-dev] [PATCH] nm-dispatcher: handle NTP servers from DHCP

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Thu, May 21, 2020 at 10:39 AM Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
>
> With this change the example NM dispatcher script would depend on the
> chrony-helper script, which is not included in the upstream
> repository. The patch should be downstream, or the helper script needs
> to be modified to work on all (systemd-based?) distributions and
> included here first. Things like /etc/sysconfig/ and the PEERNTP
> variable are specific to Fedora/RHEL.

Right, I see. Diffing the Fedora RPM with the Debian chrony-helper [1]
as an example, the differences are not too major (directory paths, not
sourcing /etc/sysconfig, and no use of $PEERNTP as you mentioned).
OpenSUSE [2] doesn't appear to have many differences aside from not
using /etc/sysconfig.

Would it be reasonable to check `os-release`, and source /etc/sysconfig
if `ID`/`ID_LIKE` has `fedora` or `rhel`? Directories set by
$chrony_conf, $chrony_service, and $helper_dir could be set in an
environment file maintained downstream (with defaults to certain
locations). Other than that, places where $PEERNTP and $NTPSERVERARGS
are used which normally come from sysconfig could be left as-is, and
have distributions set them to an empty value in the downstream
environment file, or make their use conditional on the `os-release`check
above.

With the changes above I think we'd have a sufficiently configurable
chrony-helper script that'd generally work across distributions. May not
be able to account for certain cases (e.g. distros outside of
Fedora/RHEL/CentOS that might be using /etc/sysconfig?). If the changes
sound reasonable, I'd be happy to work on the edits to chrony-helper and
adding it to this patchset, as part of upstreaming this functionality.

[1] https://salsa.debian.org/debian/chrony/-/blob/master/debian/chrony-helper
[2] https://build.opensuse.org/package/view_file/openSUSE:Factory/chrony/chrony.helper


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/