Re: [chrony-users] DHCP and Chrony

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


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.  

Best,
-Pat

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








Patrick Whitney
DevOps Engineer



On Thu, Jul 18, 2019 at 3:02 PM Youssef Ghorbal <youssef.ghorbal@xxxxxxxxx> wrote:
I don’t think it’s built-in in chrony itself.

CentOS 7 for exemple ships with a helper wrapper that is run as a poststart in the systemd chrony unit file. This helper script does exactly what you want as it checks dhcp leases and add ntp servers referenced there to the sources list (it levereges chronyc cli) it also adds those referenced in DNS SRV records of the zone (if available)

The script’s path is /usr/libexec/chrony-helper

Youssef


On Thu 18 Jul 2019 at 19:34, Patrick Whitney <pwhitney@xxxxxxxxxxxx> wrote:
Hi Everyone,

I'm running chrony 3.2 on Ubuntu 18.04.  I was expecting it to add the NTP server in the DHCP list to the list of sources, but that's not happening. 

Being new to chrony, I may be missing something, but I'm not finding a way to configure chrony to pull the address from the lease, like NTP would.  

Is chrony capable of pulling an NTP server address from a DHCP lease? 

Thanks in advance!!
-Pat


Patrick Whitney
DevOps Engineer



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