[pkg-ntp-maintainers] Bug#600661: Bug#600661: ntp: Uses /var/lib/ntp/ntp.conf.dhcp regardless!?
Kurt Roeckx
kurt at roeckx.be
Sun May 27 23:12:15 UTC 2012
On Mon, May 28, 2012 at 01:37:20AM +0300, Tero Marttila wrote:
> >>Purging /ntp/ntp.conf.dhcp
> >>on boot would be a start, but in this case, the server has not been
> >>rebooted once since it was installed...
> >
> >It should actually purge that file on reboot.
>
> On a fresh VM with Debian Squeeze 6.0.5 installed (netinst + DHCP),
> with `apt-get install ntp` such that rebooting gives me a
> /var/lib/ntp/ntp.conf.dhcp;
>
> Editing /etc/network/interfaces to replace the default 'iface eth0
> inet dhcp' with 'iface eth0 inet static' + address/netmask/gateway,
> and immediately rebooting, leaves me with a persistent stale
> /var/lib/ntp/ntp.conf.dhcp that does not go away.
And you didn't kill -9 the dhcp client or something?
dhcp is supposed to call /etc/dhcp/dhclient-exit-hooks.d/ntp with
STOP or something.
> A stale ntp.conf.dhcp that persists across reboots will be
> surprising to administrators, and not always that easy to notice
> (the NTP servers supplied via DHCP during install may continue to
> function for some time before being taken out of service).
>
> I am unable to find any reference to purging the ntp.conf.dhcp at
> boot in Squeeze's /etc or the recent packages.debian.org changelogs?
> I do not have a wheezy/sid install available for testing, though.
Maybe dhcp calls /etc/dhcp/dhclient-exit-hooks.d/ntp with REBOOT
and "$new_ntp_servers" = "$old_ntp_servers", both being empty,
and we just return leaving the file instead of cleaning it up?
Moving this to the start of the function might fix that:
if [ -z "$new_ntp_servers" ]; then
ntp_servers_setup_remove
return
fi
Kurt
More information about the pkg-ntp-maintainers
mailing list