ntpd can use stale /var/lib/ntp/ntp.conf.dhcp config
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ntp (Debian) |
Fix Released
|
Unknown
|
|||
ntp (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Today, I noticed that my laptop's time was ~4s ahead of my home NTP server. Looking at 'ntpdc -sn localhost' I noticed that my laptop was trying to sync with an unknown and unreachable server. Surprisingly, this server was not in /etc/ntp.conf.
After some debugging, I found a stale /var/lib/
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: ntp 1:4.2.6.
ProcVersionSign
Uname: Linux 3.13.0-57-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.11
Architecture: amd64
Date: Mon Jul 6 22:27:52 2015
InstallationDate: Installed on 2014-01-26 (526 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20140124)
KernLog:
Jul 6 07:42:09 simon-laptop kernel: [116085.154414] ata1.00: ACPI cmd f5/00:00:
Jul 6 07:42:09 simon-laptop kernel: [116085.157431] ata1.00: ACPI cmd f5/00:00:
Jul 6 12:07:27 simon-laptop kernel: [132003.862223] type=1400 audit(143619884
Jul 6 19:54:12 simon-laptop kernel: [153828.256900] ata1.00: ACPI cmd f5/00:00:
Jul 6 19:54:12 simon-laptop kernel: [153828.259982] ata1.00: ACPI cmd f5/00:00:
NtpStatus:
remote refid st t when poll reach delay offset jitter
======
ntp.sdeziel.inf 206.108.0.132 2 u 37 64 1 5.967 -34.563 0.000
ProcEnviron:
LANGUAGE=en_US
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ntp
UpgradeStatus: No upgrade log present (probably fresh install)
modified.
modified.
mtime.conffile.
mtime.conffile.
Related branches
Changed in ntp (Debian): | |
status: | Unknown → New |
Changed in ntp (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in ntp (Ubuntu): | |
status: | Confirmed → Fix Committed |
Changed in ntp (Debian): | |
status: | New → Fix Released |
The stale file was apparently left by /etc/dhcp/ dhclient- exit-hooks. d/ntp. Since this dhclient script updates the ntp.conf.dhcp file when a new NTP server is advertised via DHCP, it should be OK to always use the most recent file between /var/lib/ ntp/ntp. conf.dhcp and /etc/ntp.conf.
The attached patch changes the initscript to use /var/lib/ ntp/ntp. conf.dhcp only if it is newer than /etc/ntp.conf.