Bug 1466947

Summary: ntpdate.service should start after network-online.target
Product: Red Hat Enterprise Linux 7 Reporter: Orion Poplawski <orion>
Component: ntpAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED ERRATA QA Contact: Andrej Dzilský <adzilsky>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.3CC: adzilsky, fkrska, jscalf, lnykryn, mmezynsk, psklenar, thaller
Target Milestone: rcKeywords: EasyFix, Patch, Reproducer
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ntp-4.2.6p5-28.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 15:25:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1420851, 1465928    

Description Orion Poplawski 2017-06-30 20:29:16 UTC
Description of problem:

The ntpdate service starts before the network is online resulting in spurious messages like:

Jun 26 15:36:12 aspen ntpdate[641]: Can't find host ntp.cora.nwra.com: Name or service not known (-2)

It should have After=network-online.target instead of network.target, see https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

/usr/libexec/ntpdate-wrapper keeps trying until the network is up, so the service ultimately succeeds, but this just seems like a hack around not having the proper target.

Version-Release number of selected component (if applicable):
ntp-4.2.6p5-25.el7_3.2.x86_64

Looks like this was fixed in Fedora a while back (bug #1116474), would be nice to get this into RHEL7.

Comment 20 Thomas Haller 2018-02-17 12:45:46 UTC
Up until (including) rhel-7.4, NetworkManager package installs a symlink

/usr/lib/systemd/system/network-online.target.wants/NetworkManager-wait-online.service

which effectively means that Nm-w-o.service is always pulled in by network-online.target (even if it was disabled). The only way to not run that service was by masking it (however, that still results in a harmless but ugly failure message during boot).

In Fedora and RHEL-7.5, this file will no longer be installed. This makes NM-w-o.service work as one would expect. However, we will also enable the service by default via preset (rh 1520867).

> [2] https://bugzilla.redhat.com/show_bug.cgi?id=1455704

yes, this bug is exactly about what I just said (for Fedora), and we are doing the same with rhel-7.5.


Regarding comment 18, on rhel <= 7.4 it would be expected that NM-w-o.service is disabled. However, it should anyway be started. That's why I don't understand how enabling the service could make any difference to the user and doubt that this claim is accurate.
Maybe comment 18 talks about some earlier rhel-7.5 snapshots, where the preset was not yet set to enable the service. That bug has been fixed in 7.5 in the meantime.

Comment 24 errata-xmlrpc 2018-04-10 15:25:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0855