[Networkmanager] NetworkManager handling of NTP options

mh at mike.franken.de mh at mike.franken.de
Fri Mar 10 21:18:23 UTC 2023

On Freitag, 10. März 2023 22:07:49 CET Thomas Haller wrote:
> On Fri, 2023-03-10 at 21:50 +0100, mh at mike.franken.de wrote:
> > Hi *,
> > 
> > I am using systemd-timesyncd for managing the ntp server entries on
> > my
> > clients. Because NetworkManager doesn't update timesyncd.conf, I
> > wrote a
> > dispatcher script, that is doing this job. The script is using the
> Maybe NetworkManager should directly integrate with timesyncd or crony.
> On the other hand, the dispatcher solution may not be too terrible...
> Maybe in the future, a NetworkManager profile could just have a "ntp"
> option, which the dispatcher script could read and use -- or, if NM
> directly integrates with timesyncd/chrony to actively push those
> settings.

A direct integration would be great of course, but the dispatcher solution is 
sufficient for me, especially because it is under my control ;)

> > Whats more: If this static entry exists, NetworkManager is writing it
> > to the
> > above mentioned files even if it gets ntp servers from a DHCP
> > connection. Is
> > this correct?

> Of course, if you somehow like "NETCONFIG_NTP_STATIC_SERVERS", then the
> your dispatcher script could read that variable from somewhere... you
> can script whatever suits you.


> Note that connection profiles already support arbitrary user-data, so
> you could set a user-data in the profile like "my.ntp.servers=...".
> That could be nice, but the major problem with that is, that nmcli
> doesn't support getting/setting those fields, that makes it rather
> cumbersome. The example script [1] shows how to access user-data from
> python.

This sounds like a really interesting possibility.
I don't care for any tool in this case. It would be a write once, read many 
entry, so one can write it to the connection file, restart nm and here we go.
I'll give it a try.


Thy and bye.

More information about the Networkmanager mailing list