ntpdate.dhcp always ignored

Bug #427775 reported by Raven on 2009-09-11
56
This bug affects 8 people
Affects Status Importance Assigned to Milestone
ntp (Debian)
Fix Released
Unknown
ntp (Ubuntu)
Wishlist
Christian Ehrhardt 
Trusty
High
Unassigned

Bug Description

Ubuntu 9.04, affects the ntpdate binary package

Problem: Using dhcp a file ntpdate.dhcp is created but never used.

By default NTPDATE_USE_NTP_CONF in /etc/default/ntpdate is set to "yes". This has the following consequences:

/usr/sbin/ntpdate-debian parses /etc/default/ntpdate and checks for /etc/ntp.conf.dhcp /etc/ntp.conf /etc/openntpd/ntpd.conf if NTPDATE_USE_NTP_CONF is set to yes. By default ntpd is not installed therefore there is no /etc/ntp.conf.dhcp /etc/ntp.conf or /etc/openntpd/ntpd.conf. ntpdate-debian then defaults to the NTPSERVERS set in /etc/default/ntpdate, namely "ntp.ubuntu.com". Only if NTPDATE_USE_NTP_CONF is set to "no" there will be a check for /etc/default/ntpdate.dhcp and consequently the server supplied by dhcp be used.

I propose to set NTPDATE_USE_NTP_CONF to "no" by default. If ntpd is installed, this will override the use of ntpdate and /etc/ntpd.conf.dhcp and /etc/default/ntpdate.dhcp will both be created by DHCP anyway, therefore both packages will use the DHCP supplied servers in any case.

description: updated
tags: added: jaunty
tags: added: string-fix
Chuck Short (zulcss) wrote :

Thanks for the bug report and your analysis.

Regards
chuck

Changed in ntp (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Colin Watson (cjwatson) wrote :

One issue with this is that gnome-system-tools/system-tools-backends is set up to edit /etc/ntp.conf by default (although it's not obvious to me that it does so quite correctly, but anyway ...). Perhaps it would be more straightforward for /etc/network/if-up.d/ntpdate to fall back to /etc/default/ntpdate.dhcp if it doesn't find any ntp.conf-style server configuration?

Ivan Borzenkov (ivan1986) wrote :

In the original script broken logic - dhcp should be checked when the no of their preferences, rather than when they are disabled.
Even after the dhcp settings should override if they are there.

tags: added: patch
tags: removed: jaunty
YunQiang Su (wzssyqa) wrote :

As for now gnome 3.8 will be released, and gnome-system-tools is still 3.0.
It seems that gnome-system-tools is dead.

I think that we can fix this now.

Ivan Borzenkov (ivan1986) wrote :

And what have the Gnome if you need a fix how to check the files in the script.

Ivan Borzenkov (ivan1986) wrote :

4 years, 2 years whis patch...
trivial fix...
5 distros
https://launchpad.net/~ivan1986/+archive/ppa/+sourcepub/2085289/+listing-archive-extra
RRRRR

Jorge Niedbalski (niedbalski) wrote :

For MAAS users. A quick workaround that you can use for this, is to setting NTPDATE_USE_NTP_CONF to NO via the generic preseed file.

Edit /etc/maas/preseeds/generic, add a late_command into the file

d-i preseed/late_command string true && \
in-target sed -i 's/NTPDATE_USE_NTP_CONF=yes/NTPDATE_USE_NTP_CONF=no/'
/etc/default/ntpdate

This change will force the usage of /var/lib/ntpdate/default.dhcp , which is being written correctly by MAAS.

The proper solution for this fix would be to fix the ntpdate package to fall back to /etc/default/ntpdate.dhcp if it doesn't find any ntp.conf configuration by default.

information type: Public → Public Security
information type: Public Security → Public
Changed in ntp:
status: Unknown → New

We need this for MAAS ntp in Trusty, adding a bug task

Changed in ntp (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → High

FYI - I sent an updated patch to Debian for inclusion before we do the next ntp merge.
After this is done we will think about SRUs of the accepted solution.

Changed in ntp (Ubuntu):
assignee: nobody → ChristianEhrhardt (paelzer)

In reference to [1] the TL;DR summary is that:
1. ntpdate is deprecated
2. the patches got polished, tested and provided to Debian but not yet picked up
3. we are unwilling to add more delta to Debian for a deprecated binary
#. so if they are merged in Debian we will pick it up in the next Release, but unlikely do an SRU for it.

Great and more detailed summary including potential workarounds for old issues can be read at:
[1]: https://lists.ubuntu.com/archives/ubuntu-devel/2016-August/039484.html

Changed in ntp (Ubuntu Trusty):
status: Triaged → Won't Fix
Changed in ntp (Ubuntu):
status: Triaged → Won't Fix
Ivan Borzenkov (ivan1986) wrote :

cool
7 years
and close
epic fail

affects: ntp → ubuntu-translations
Changed in ubuntu-translations:
importance: Unknown → Undecided
no longer affects: ubuntu-translations
Changed in ntp (Debian):
status: Unknown → New
Changed in ntp (Debian):
status: New → Fix Released

Hey movement on Debian, thanks Kurt.
Opening that up for the next development release merge we do.

Changed in ntp (Ubuntu):
status: Won't Fix → Triaged

Ok, there was no response so far - merging the latest state for Zesty Release.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ntp - 1:4.2.8p9+dfsg-2ubuntu1

---------------
ntp (1:4.2.8p9+dfsg-2ubuntu1) zesty; urgency=medium

  * Merge from Debian testing. Remaining changes (LP: #427775):
    + d/rules: enable debugging
    + d/rules, d/ntp.dirs, d/source_ntp.py: Add apport hook.
    + d/ntpdate.if-up: Fix interaction with openntpd. Stop ntp before
      running ntpdate when an interface comes up, then start again afterwards.
    + d/ntp.init: Only stop when entering single user mode
    + d/ntp.init don't use /var/lib/ntp/ntp.conf.dhcp if /etc/ntp.conf is
      newer, it can get stale. Patch by Simon Déziel. (refreshed to apply to
      new path /run/ntp.conf.dhcp)
    + d/ntp.conf, d/ntpdate.default: Change default server to ntp.ubuntu.com.
    + d/control: Add bison to Build-Depends (for ntpd/ntp_parser.y).
    + Fix ntpdate-debian to be able to parse new config of ntp
    + Add PPS support:
      - d/README.Debian: Add a PPS section to the README.Debian,
        removed all PPSkit one.
      - d/ntp.conf: Add some configuration examples from the offical
        documentation.
    + Add Apparmor bits not yet accepted in Debian
      - d/control: Add Suggests on apparmor.
      - d/source_ntp.py: Add filter on AppArmor profile names to prevent
        false positives from denials originating in other packages
      - d/apparmor-profile add samba winbindd pipe
      - Create etc/apparmor.d/{force-complain,tunables}/
  * Drop Changes:
    + SECURITY UPDATE: NTP statsdir cleanup cronjob insecure
      (was accepted in Debian).
    + d/control: different conflicts/replaces versions on apparmor (was a
      dependency on a higher apparmor version, but today all releases are newer)

 -- Christian Ehrhardt <email address hidden> Thu, 01 Dec 2016 15:40:22 +0100

Changed in ntp (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.