sntp missing

Bug #1604010 reported by Markus Kuhn
40
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Ubuntu Server Guide
Fix Released
Undecided
Christian Ehrhardt 
ntp (Debian)
Fix Released
Unknown
ntp (Ubuntu)
Fix Released
Medium
Christian Ehrhardt 

Bug Description

In Ubuntu 16.04, the binary file /usr/bin/sntp is missing from the package ntp. The associated man page /usr/share/man/man1/sntp.1.gz is still included.

How to reproduce:

$ sudo apt-get install ntp
$ dpkg-query -L ntp | grep sntp
/usr/share/man/man1/sntp.1.gz

Expected result:

/usr/bin/sntp was included in Ubuntu 14.04:

$ dpkg-query -L ntp | grep sntp
/usr/bin/sntp
/usr/share/man/man1/sntp.1.gz

The sntp program remains a very useful tool for interactively testing on the command line the offset of the local clock to a remote NTP server (like "ntpdate -qu [ntp-server]" previously). It should be included in the same package as its man page.

Related branches

Revision history for this message
Eric Tittley (eric-r-tittley) wrote :

sntp is not just a useful tool, it is essential for ntpsweep (included in the ntp pacakge).

> ntpsweep --host 0.ubuntu.pool.ntp.org
Host st offset(s) version system processor
--------------------------------+--+---------+-----------+------------+---------
Can't exec "sntp": No such file or directory at /usr/share/ntp/lib/NTP/Util.pm line 133.
Could not start sntp: No such file or directory at /usr/bin/ntpsweep line 112.

Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Confirmed that the manpage is present but the binary is missing. This needs further investigation (as to whether there is some logic to this or it is just a mistake).

tags: added: server-next
Changed in ntp (Ubuntu):
assignee: nobody → ChristianEhrhardt (paelzer)
Robie Basak (racb)
tags: removed: server-next
Changed in ntp (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi,
I took a look as I recently hacked on ntp packaging.
I can confirm the issue and also that it affects Debian as well.

I'll dig a bit where/why it came from and then update accordingly.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Interestingly it was configured and build with "--with-sntp=no" all the time back as far as history goes.

Since 4.2.8 ntp brings their own manpage, so the sntp manpage patch got dropped.

As I identified Debian being affected as well I searched there and found the reason it was disabled to begin with. There is also a bug discussing to re-enable it ... linking here.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I was building upstream ntp as-is having --with-sntp=no as debian/rules does.
And just as I assumed, the old 4.2.6 build "ignored" the "--with-sntp=no" and built it anyway.
While the new one follows the order.

This was changed way back in:
commit dd3be096e78eb8d13da36caad215c9f5c009b11a
Author: <email address hidden>
Date: Sun Feb 20 20:23:00 2011 +0000

    Attempt typical subpackage approach for libevent
    sntp test cleanup

But this is just where 4.2.7/4.2.8 development started which is why it is different in 4.2.6 as in Trusty/Jessie.

Changed in ntp:
status: Unknown → New
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Just dropping the --with-sntp=no would have been too easy (thanks Murphy).
It runs into build issues.

I was able to track those down to one of the build deps in combination with no more disabling sntp causing this => autogen.

But then removing autogen build dep is not a "solution" - especially not one thinking of an SRU later. As it might cause all kind of changed behavior.
The other way is to remove --disable-local-libopts as well, but that change as well could cause anything without knowing the code.

I'll open an upstream bug to discuss and let the Debian bug know as well.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Draft debdiff to enable and provide sntp in Yakkety.

For now only meant as reference - please do not upload yet.
If there is a autosubscribe of sponsors please due to this being a patch please ubsubscribe for now.

It has to changes to internal libopts and thereby drops the libopts25 runtime dependency.
I want to wait for ntp.org feedback what else will change before doing that change.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

BTW - ntpsweep is not particularly stable or correct - so I don't know how much of a "reason to need sntp" it is.

ntpsweep --host 0.debian.pool.ntp.org
Host st offset(s) version system processor
--------------------------------+--+---------+-----------+------------+---------
0.debian.pool.ntp.org: timed out, nothing received
***Request timed out
Use of uninitialized value $daemonversion in substitution (s///) at /usr/bin/ntpsweep line 122.
Use of uninitialized value $daemonversion in substitution (s///) at /usr/bin/ntpsweep line 123.
Use of uninitialized value $daemonversion in substitution (s///) at /usr/bin/ntpsweep line 124.
Use of uninitialized value $daemonversion in substitution (s///) at /usr/bin/ntpsweep line 125.
Use of uninitialized value $daemonversion in substitution (s///) at /usr/bin/ntpsweep line 126.
Use of uninitialized value $daemonversion in substitution (s///) at /usr/bin/ntpsweep line 127.
Use of uninitialized value $system in substitution (s///) at /usr/bin/ntpsweep line 130.
Use of uninitialized value $system in substitution (s///) at /usr/bin/ntpsweep line 131.
Use of uninitialized value $system in substitution (s///) at /usr/bin/ntpsweep line 132.
Use of uninitialized value $processor in substitution (s///) at /usr/bin/ntpsweep line 135.
Use of uninitialized value $daemonversion in sprintf at /usr/bin/ntpsweep line 153.
Use of uninitialized value $system in sprintf at /usr/bin/ntpsweep line 153.
Use of uninitialized value $processor in sprintf at /usr/bin/ntpsweep line 153.
stratum-1.sjc02.svwh.net 1 0.003

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

bugs.ntp.org is encountering internal server errors on bug submission, I'll update once I was able to submit.

Revision history for this message
Markus Kuhn (markus-kuhn) wrote :

General comment: I would not consider "Use of uninitialized value" warnings in Perl on their own as evidence of a lack of software quality. If a Perl programmer deliberately used the fact that undef also works as an empty string, I would still consider that to be a perfectly legitimate Perl programming style.

Such warnings often occur only because some 'warnings zealot' had added a '-w' option to the shebang line without also putting in the then essential "no warnings 'uninitialized';" pragma required for this Perl programming style.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

That is true @Markus Kuhn - I just wanted to mention it after testing the debdiff I attached a bit as - severe or not - it is the first thing that really meets the eye.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "experimental debdiff for discussion and as reference" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

@Sponsors - as written above, please unsubscribe yourself for now, unfortunately I can't do that for you.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

NTP.org discussion on the missing EX_* definitions ongoing in NTP bug 3096
=> http://bugs.ntp.org/show_bug.cgi?id=3096

Mathew Hodson (mhodson)
affects: ntp → ubuntu
Changed in ubuntu:
importance: Unknown → Undecided
no longer affects: ubuntu
Mathew Hodson (mhodson)
tags: added: regression-release
Changed in ntp (Debian):
status: Unknown → New
Revision history for this message
costinel (costinel) wrote :

workaround for ubuntu 16.04 lts is to install the deprecated ntpdate that still works ok:

ntpdate:amd64/xenial-security 1:4.2.8p4+dfsg-3ubuntu5.3 uptodate

Changed in ntp (Debian):
status: New → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

We didn't want to diverge until Debian decided to either ship it or fully remove it.
Now Debian release at least to experimental (but only there so far).

Given the low prio/impact this had overall so far, we will likely pick it up in the merge for the aa-release and then consider SRUing it back.

Waiting the ~8 weeks until the merge work begins for next cycle will also help to ensure there is no rolling back on the Debian side since this is only in experimental so far as mentioned above.

If one is willing to do the work on it before that time I'm open to helping him/her.

Overall the sntp change consists of:
- debian/patches/sntp-sysexits.patch (to allow it to build)
- dropping --with-sntp=no
- adding in debian/ntp.install
- there also was some major overhaul in d/rules which will have to be adapted for SRUs

Revision history for this message
Mikkel Kirkgaard Nielsen (mikini) wrote :

Am affected by the missing sntp binary also.

For reference the Debian bug mentioned in comment #4 is https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=793837.

Also note that the workaround mentioned in #15 does not (AFAICT from https://github.com/ntp-project/ntp/blob/master/ntpdate/ntpdate.c) use the SNTP protocol, so it does not serve identical function as the sntp tool.

Installing package rdate will give you the rdate tool which can retrieve time using the SNTP protocol using its -n option (-p here for just printing the retrieved date):
$ rdate -n -p ntp.ubuntu.com
Wed May 24 13:14:52 UTC 2017

Also note that on Ubuntu 16.04 by default time synchronization has been taken over by systemd's timesyncd (man systemd-timesyncd), so neither package ntp (with execs ntpd and missing sntp) or package ntpdate are necessary for a machine to synchronize its time against a NTP server. Read something about that in https://help.ubuntu.com/lts/serverguide/NTP.html which is a fine intermingled mess of ntpd and timesyncd instructions.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Added a serverguide task to clean up the the mentioned section.
Both should stay but split more clearly.

Also FYI the merge of latest ntp is on the way which will bring sntp back as it should be for Artful and later.
It is part of a new package there - not sure if this qualifies as an SRU or if we instead want to do different (or not). But lets finish the merge for the development release first.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ntp - 1:4.2.8p10+dfsg-5ubuntu1

---------------
ntp (1:4.2.8p10+dfsg-5ubuntu1) artful; urgency=medium

  * Merge with Debian unstable (LP: #1604010). Remaining changes:
    - d/ntp.conf, d/ntpdate.default: Change default server to ntp.ubuntu.com.
    - Add PPS support (LP 1512980):
      + debian/README.Debian: Add a PPS section to the README.Debian,
        removed all PPSkit one.
      + debian/ntp.conf: Add some configuration examples from the offical
        documentation.
  * Drop Changes (contribs accepted in Debian):
    - Apparmor bits not yet accepted in Debian
      + d/apparmor-profile add samba winbindd pipe (LP 1582767)
    - Fix ntpdate-debian to be able to parse new config of ntp (LP 1576698)
    - d/rules: enable debugging
    - d/rules, d/ntp.dirs, d/source_ntp.py: Add apport hook.
      + d/source_ntp.py: includes a filter on AppArmor profile names to prevent
        false positives from denials originating in other packages

 -- Christian Ehrhardt <email address hidden> Wed, 21 Jun 2017 16:17:38 +0200

Changed in ntp (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Provided a suggestion for the serverguide to improve and soemwhat un-tangle timedatectl/timesyncd/ntpd.

Changed in serverguide:
status: New → In Progress
assignee: nobody → ChristianEhrhardt (paelzer)
Changed in serverguide:
status: In Progress → Fix Committed
Changed in serverguide:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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