← Back to team overview

touch-packages team mailing list archive

[Bug 1342522] [NEW] request ntp-servers does not remove manually configured servers

 

Public bug reported:

Suppose that one has the following lines in /etc/ntp.conf

server ntp.com iburst
restrict ntp.com mask 255.255.255.255 nomodify notrap nopeer noquery
server ntp2.com iburst
restrict ntp2.com mask 255.255.255.255 nomodify notrap nopeer noquery
server ntp3.com iburst
restrict ntp3.com mask 255.255.255.255 nomodify notrap nopeer noquery
server ntp4.com iburst
restrict ntp4.com mask 255.255.255.255 nomodify notrap nopeer noquery

The idea behind requesting DHCP option 42 is to replace these servers
with those provided from a DHCP server. I find that, in trusty, only the
first server is replaced in /var/lib/ntp/ntp.conf.dhcp.

I think this traces back to the following line in /etc/dhcp/dhclient-
exit-hooks.d/ntp:

sed -r -e '/^ *(server *[^1][^2][^7]\.|peer).*$/d' $NTP_CONF

I venture that this regex is intended to avoid the "server 127.0.0.1
fudge" line one often sees. But by requiring a direct match to the '.'
separator in the IP address, it has the effect that any server line in
which the shortname of the host is more than 3 characters long won't be
removed.

The same sed in Debian 7 is:

sed -r -e '/^ *(server|peer).*$/d' $NTP_CONF

This may remove that localhost fudging, but it clearly removes any
hardcoded /etc/ntp.conf servers.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: isc-dhcp-client 4.2.4-7ubuntu12
ProcVersionSignature: Ubuntu 3.13.0-30.55-generic 3.13.11.2
Uname: Linux 3.13.0-30-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
Date: Tue Jul 15 23:55:21 2014
InstallationDate: Installed on 2014-07-10 (5 days ago)
InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: isc-dhcp
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: isc-dhcp (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug trusty

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to isc-dhcp in Ubuntu.
https://bugs.launchpad.net/bugs/1342522

Title:
  request ntp-servers does not remove manually configured servers

Status in “isc-dhcp” package in Ubuntu:
  New

Bug description:
  Suppose that one has the following lines in /etc/ntp.conf

  server ntp.com iburst
  restrict ntp.com mask 255.255.255.255 nomodify notrap nopeer noquery
  server ntp2.com iburst
  restrict ntp2.com mask 255.255.255.255 nomodify notrap nopeer noquery
  server ntp3.com iburst
  restrict ntp3.com mask 255.255.255.255 nomodify notrap nopeer noquery
  server ntp4.com iburst
  restrict ntp4.com mask 255.255.255.255 nomodify notrap nopeer noquery

  The idea behind requesting DHCP option 42 is to replace these servers
  with those provided from a DHCP server. I find that, in trusty, only
  the first server is replaced in /var/lib/ntp/ntp.conf.dhcp.

  I think this traces back to the following line in /etc/dhcp/dhclient-
  exit-hooks.d/ntp:

  sed -r -e '/^ *(server *[^1][^2][^7]\.|peer).*$/d' $NTP_CONF

  I venture that this regex is intended to avoid the "server 127.0.0.1
  fudge" line one often sees. But by requiring a direct match to the '.'
  separator in the IP address, it has the effect that any server line in
  which the shortname of the host is more than 3 characters long won't
  be removed.

  The same sed in Debian 7 is:

  sed -r -e '/^ *(server|peer).*$/d' $NTP_CONF

  This may remove that localhost fudging, but it clearly removes any
  hardcoded /etc/ntp.conf servers.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: isc-dhcp-client 4.2.4-7ubuntu12
  ProcVersionSignature: Ubuntu 3.13.0-30.55-generic 3.13.11.2
  Uname: Linux 3.13.0-30-generic x86_64
  ApportVersion: 2.14.1-0ubuntu3.2
  Architecture: amd64
  Date: Tue Jul 15 23:55:21 2014
  InstallationDate: Installed on 2014-07-10 (5 days ago)
  InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: isc-dhcp
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1342522/+subscriptions


Follow ups

References