[Bug 1578663] Re: create DHCP exit hook for setting NTP servers through dhclient

Adam Conrad adconrad at 0c3.net
Thu May 12 09:11:10 UTC 2016

Hello Martin, or anyone else affected,

Accepted systemd into xenial-proposed. The package will build now and be
available at https://launchpad.net/ubuntu/+source/systemd/229-4ubuntu6
in a few hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to
enable and use -proposed.  Your feedback will aid us getting this update
out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, and change the tag
from verification-needed to verification-done. If it does not fix the
bug for you, please add a comment stating that, and change the tag to
verification-failed.  In either case, details of your testing will help
us make a better decision.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in

** Changed in: systemd (Ubuntu Xenial)
       Status: In Progress => Fix Committed

** Tags added: verification-needed

You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.

  create DHCP exit hook for setting NTP servers through dhclient

Status in systemd package in Ubuntu:
  Fix Committed
Status in systemd source package in Xenial:
  Fix Committed
Status in systemd source package in Yakkety:
  Fix Committed

Bug description:
  Similar to /etc/dhcp/dhclient-exit-hooks.d/ntpdate, we should ship a
  DHCP exit hook for timesyncd to update the timesyncd configuration in
  /run/systemd/timesyncd.conf.d/01-dhclient.conf to set the picked up
  NTP servers, and restart timesyncd.

  Rationale: This is a regression compared to trusty where we used ntpdate; /etc/dhcp/dhclient-exit-hooks.d/ntpdate ran ntpdate on the new NTP servers. This causes timesyncd to always try and talk to the disto configured server (ntp.ubuntu.com) which might be disallowed by firewall rules or other networking policy. Thus machines in such an environment never get a correct time sync even when they get a local NTP server advertised over DHCP (unless they use systemd-networkd, which is not done by default in Xenial).

  Test case:
  - Set up a DHCP server that includes NTP information. For example, you can set LXC_DHCP_CONFILE=/etc/lxc/dnsmasq.conf in /etc/default/lxc-net, and create /etc/lxc/dnsmasq.conf with "dhcp-option=option:ntp-server,", and then run QEMU on lxcbr0 instead of the builtin network.
  - In the client machine, disconnect and reconnect the network (e. g. "sudo ifdown ens3; sudo ifup ens3").
  - Check in "systemctl status systemd-timesyncd" that timesyncd tries to sync with the given NTP server (for the bogus it will fail, but the point is that it did try).

  Regression potential: A broken dhclient-exit-hooks.d has the potential
  to break subsequent hooks. dhclient-scripts runs the hooks without
  "set -e", but syntax errors can still cause damage. Thus it should be
  verified that later hooks (e. g. /etc/dhcp/dhclient-exit-hooks.d
  /zzz_avahi-autoipd) still run. Beyond that there is little potential
  for regression as

To manage notifications about this bug go to:

More information about the foundations-bugs mailing list