Re: [chrony-users] DHCP and Chrony

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


On Thu, Jul 18, 2019 at 03:41:28PM -0400, Patrick Whitney wrote:
Thanks, Youssef.   That was helpful.

It looks like chrony-helper is looking for DHCP leases in the location
where dhleases drops the file.   Unfortunately, Ubuntu 18.04 does not keep
its lease files in the same location (or format, i.e. just changing the
location of the leases directory does not resolve the issue...).

I think I have a(n extremely ugly) work around (see below), but it would be
nice if chrony-helper could be fixed to do the right thing in Ubuntu
18.04.

Sure, we could extend the chrony helper script to look for NTP servers obtained by the systemd-networkd DHCP client but that would not be enough because chronyd would use them only when {re}starting.

What we need here is a systemd-networkd mechanism that updates chronyd *each time* it obtain a DHCP lease that comes with an NTP server option. Does such a mechanism exist today?

Best,
-Pat

Cheers,
Vincent

workaround:  chronyc -a -m "add server `grep NTP
/run/systemd/netif/leases/2 | sed -e 's/NTP=//'`"

By the way, the “-a” option is ignored on modern chrony version. ;-)

Attachment: signature.asc
Description: PGP signature



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