systemd: ntpdate is started too soon (before the network)

Bug #1447142 reported by Laurent Bonnaud on 2015-04-22
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ntp (Ubuntu)
Low
Unassigned

Bug Description

Here is what I see in journalctl: ntpdate cannot do DNS resolution because NetworkManager has not finished configuring the network interface.

Apr 21 22:01:13 xeelee ntpdate[1563]: Can't find host 0.ubuntu.pool.ntp.org: Name or service not known (-2)
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> init!
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> update_system_hostname
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> interface-parser: parsing file /etc/network/interfaces
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> interface-parser: finished parsing file /etc/network/interfaces
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> management mode: unmanaged
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> devices added (path: /sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/net/wlan0,
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> device added (path: /sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/net/wlan0,
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> devices added (path: /sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/net/eth0,
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> device added (path: /sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/net/eth0, i
Apr 21 22:01:13 xeelee ntpdate[1563]: Can't find host 1.ubuntu.pool.ntp.org: Name or service not known (-2)
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> devices added (path: /sys/devices/virtual/net/lo, iface: lo)
Apr 21 22:01:13 xeelee smartd[1495]: Device: /dev/sdc [USB JMicron], no ATA CHECK POWER STATUS support, ignoring -n Directive
Apr 21 22:01:13 xeelee ntpdate[1563]: Can't find host 2.ubuntu.pool.ntp.org: Name or service not known (-2)
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> device added (path: /sys/devices/virtual/net/lo, iface: lo): no ifupdown configur
Apr 21 22:01:13 xeelee smartd[1495]: Device: /dev/sdc [USB JMicron], is SMART capable. Adding to "monitor" list.
Apr 21 22:01:13 xeelee ntpdate[1563]: Can't find host 3.ubuntu.pool.ntp.org: Name or service not known (-2)
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> end _init.
Apr 21 22:01:13 xeelee smartd[1495]: Device: /dev/sdc [USB JMicron], state read from /var/lib/smartmontools/smartd.WDC_WD40EZRX_00SPE
Apr 21 22:01:13 xeelee ntpdate[1563]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> Loaded plugin ifupdown: (C) 2008 Canonical Ltd. To report bugs please use the Ne
Apr 21 22:01:13 xeelee smartd[1495]: Device: /dev/sdd [USB JMicron], opened
Apr 21 22:01:13 xeelee ntpdate[1563]: no servers can be used, exiting
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> Loaded plugin keyfile: (c) 2007 - 2013 Red Hat, Inc. To report bugs please use t
Apr 21 22:01:13 xeelee smartd[1495]: Device: /dev/sdd [USB JMicron], WDC WD40EZRX-00SPEB0, S/N:WD-WCC4E0267943, WWN:5-0014ee-25e7069b
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> SCPlugin-Ofono: Acquired D-Bus service com.canonical.NMOfono
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> SCPlugin-Ofono: init!
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> SCPlugin-Ofono: end _init.
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> Loaded plugin ofono: (C) 2013 Canonical Ltd. To report bugs please use the Netwo
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> (25444896) ... get_connections.
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> (25444896) ... get_connections (managed=false): return empty list.
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> SCPlugin-Ofono: (25249376) ... get_connections.
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> SCPlugin-Ofono: (25249376) connections count: 0
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> get unmanaged devices count: 0
Apr 21 22:01:13 xeelee smartd[1495]: Device: /dev/sdd [USB JMicron], found in smartd database: Western Digital Caviar Green (AF, SATA
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> monitoring kernel firmware directory '/lib/firmware'.
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> monitoring ifupdown state file '/run/network/ifstate'.
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> rfkill1: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.2/000
Apr 21 22:01:13 xeelee systemd[1]: Stopped LSB: Start NTP daemon.
Apr 21 22:01:13 xeelee systemd[1]: Started Authenticate and Authorize Users to Run Privileged Tasks.
Apr 21 22:01:13 xeelee systemd[1]: Started Accounts Service.
Apr 21 22:01:13 xeelee systemd[1]: Mounted Arbitrary Executable File Formats File System.
Apr 21 22:01:13 xeelee systemd[1]: Started Enable support for additional executable binary formats.
Apr 21 22:01:13 xeelee NetworkManager[1493]: <info> Loaded device plugin: /usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugi

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: ntpdate 1:4.2.6.p5+dfsg-3ubuntu6
ProcVersionSignature: Error: [Errno 2] No such file or directory: '/proc/version_signature'
Uname: Linux 4.0.0-040000-lowlatency x86_64
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
CurrentDesktop: KDE
Date: Wed Apr 22 14:09:08 2015
SourcePackage: ntp
UpgradeStatus: Upgraded to vivid on 2015-04-20 (1 days ago)

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

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

This bug still exists in wily and this package version:

Package: ntp
Version: 1:4.2.6.p5+dfsg-3ubuntu8

The error even occurs several times:

oct. 02 11:05:10 vougeot ntpdate[1464]: Can't find host 0.ubuntu.pool.ntp.org: Name or service not known (-2)
oct. 02 11:05:10 vougeot ntpdate[1464]: Can't find host 1.ubuntu.pool.ntp.org: Name or service not known (-2)
oct. 02 11:05:10 vougeot ntpdate[1464]: Can't find host 2.ubuntu.pool.ntp.org: Name or service not known (-2)
oct. 02 11:05:10 vougeot ntpdate[1464]: Can't find host 3.ubuntu.pool.ntp.org: Name or service not known (-2)
oct. 02 11:05:10 vougeot ntpd[1597]: Deferring DNS for 0.ubuntu.pool.ntp.org 1
oct. 02 11:05:10 vougeot ntpd[1597]: Deferring DNS for 1.ubuntu.pool.ntp.org 1
oct. 02 11:05:10 vougeot ntpd[1597]: Deferring DNS for 2.ubuntu.pool.ntp.org 1
oct. 02 11:05:10 vougeot ntpd[1597]: Deferring DNS for 3.ubuntu.pool.ntp.org 1
oct. 02 11:05:11 vougeot ntpdate[1902]: Can't find host 0.ubuntu.pool.ntp.org: Name or service not known (-2)
oct. 02 11:05:11 vougeot ntpdate[1902]: Can't find host 1.ubuntu.pool.ntp.org: Name or service not known (-2)
oct. 02 11:05:11 vougeot ntpdate[1902]: Can't find host 2.ubuntu.pool.ntp.org: Name or service not known (-2)
oct. 02 11:05:11 vougeot ntpdate[1902]: Can't find host 3.ubuntu.pool.ntp.org: Name or service not known (-2)
oct. 02 11:05:11 vougeot ntpd[1997]: Deferring DNS for 0.ubuntu.pool.ntp.org 1
oct. 02 11:05:11 vougeot ntpd[1997]: Deferring DNS for 1.ubuntu.pool.ntp.org 1
oct. 02 11:05:11 vougeot ntpd[1997]: Deferring DNS for 2.ubuntu.pool.ntp.org 1
oct. 02 11:05:11 vougeot ntpd[1997]: Deferring DNS for 3.ubuntu.pool.ntp.org 1
oct. 02 11:05:13 vougeot ntpd_intres[1999]: host name not found: 0.ubuntu.pool.ntp.org
oct. 02 11:05:13 vougeot ntpd_intres[1999]: host name not found: 1.ubuntu.pool.ntp.org
oct. 02 11:05:13 vougeot ntpd_intres[1999]: host name not found: 2.ubuntu.pool.ntp.org
oct. 02 11:05:13 vougeot ntpd_intres[1999]: host name not found: 3.ubuntu.pool.ntp.org

Robie Basak (racb) wrote :

Thank you for reporting this bug and helping to make Ubuntu better.

Can you explain why this is actually a problem please? Won't timesyncd suffice on a desktop that uses NetworkManager now? Is the time on your system actually falling out of sync, or is the problem just the noise of the error message?

Changed in ntp (Ubuntu):
status: Confirmed → Incomplete
Robie Basak (racb) wrote :

Once you're replied, please change the bug status back to New.

> Can you explain why this is actually a problem please?

I guess that Ubuntu systems with ntp installed would boot a little faster if ntp was not doing useless work by getting started before the network is fully up.

> Won't timesyncd suffice on a desktop that uses NetworkManager now?

Perhaps, but timesyncd is not activated by default. I had to type this command to activate it:

# timedatectl set-ntp true

While timesyncd is probably a fine alternative to ntp, this is a bug in ntp and Ubuntu would be a better system with this bug fixed (or ntp removed and timesyncd activated by default).

> Is the time on your system actually falling out of sync, or is the problem just the noise of
the error message?

Time is fine on my system, but the noise of the error messages is a problem in itself.

Changed in ntp (Ubuntu):
status: Incomplete → New
Robie Basak (racb) wrote :

Laurent,

Thank you for your reply.

> I guess that Ubuntu systems with ntp installed would boot a little faster if ntp was not doing useless work by getting started before the network is fully up.

That's reasonable, though then this bug should be of low importance I think, as the impact to users is relatively small.

> Perhaps, but timesyncd is not activated by default.

Ah. I had forgotten before, but now I remember that I was told that timesyncd is automatically deactivated if ntp is installed.

> While timesyncd is probably a fine alternative to ntp, this is a bug in ntp and Ubuntu would be a better system with this bug fixed (or ntp removed and timesyncd activated by default).

Actually ntp isn't installed by default, and thus I believe that timesyncd is activated by default, but isn't on your system because ntp is installed.

I accept that prior to Vivid timesyncd wasn't an option, so it was perfectly reasonable for users to install ntp manually, and then after upgrade if this is broken then that is a bug.

But I think the breakage is just the suboptimal attempt to sync time at boot, right? If time with ntp stays synced later without issues, then I'll set Importance to Low on this basis. If I'm wrong in my understanding then we can change this.

Changed in ntp (Ubuntu):
importance: High → Low
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

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

Other bug subscribers