Bug 1498087 - DHCP supplied NTP servers not or hardly used
Summary: DHCP supplied NTP servers not or hardly used
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: chrony
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-03 13:19 UTC by Ferry
Modified: 2018-02-27 10:33 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-27 10:33:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ferry 2017-10-03 13:19:23 UTC
Description of problem:

Currently /etc/dhcp/dhclient.d/chrony.sh is used as a script for setting certain configuration options passed by DHCP. In the current setup NTP servers provided via DHCP aren't used in the cases I've tested. The pool configured in /etc/chrony.conf is usually used. The provided servers are listed, but in our tests not preferred.

Not sure where to file this under as the script names are misleading as well. We used to use the default DHCP client (dhclient), but it is bugged, which is mostly notable on multiboot systems with Windows (Windows stores clock in localtime, we're on UTC+2 now, DHCP lease time is one hour, system clock is set 2 hours in advance, DHCP gets lease (short lease time of 1 hour), clock gets corrected, dhclient fails to renew lease - known bug - open for many years...).

As such we've switched to using NetworkManager's internal DHCP client which doesn't have the bug and fires the same scripts. Doesn't really matter which DHCP client is used thus, but it is somewhat confusing that the scripts are called via a script with dhclient in the name.


Version-Release number of selected component (if applicable):

Suggested change:

Change line 9 of /etc/dhcp/dhclient.d/chrony.sh from:

echo "$server ${NTPSERVERARGS:-iburst}" >> $SERVERFILE

To:

echo "$server ${NTPSERVERARGS:-iburst prefer}" >> $SERVERFILE

This will result in chrony giving higher preference to the DHCP provided NTP servers. If they fail it will still fallback to the pool and it's probably more in line what an administrator providing the NTP servers through DHCP would expect to happen.

Comment 1 Thomas Haller 2017-10-12 10:11:28 UTC
> As such we've switched to using NetworkManager's internal DHCP client which 
> doesn't have the bug and fires the same scripts. 

NetworkManager only calls scripts in /etc/NetworkManger/dispatcher.d (as explained in `man 8 NetworkManager`). It also does not actively communicate with chrony.


/etc/dhcp/dhclient.d/chrony.sh is provided by chrony package. Reassigning.

Comment 2 Miroslav Lichvar 2017-10-12 10:59:26 UTC
The NTP server options can be specified in /etc/sysconfig/network, e.g.

NTPSERVERARGS="iburst prefer"

As for changing the default value to include "prefer", I'm not sure. I can see that it would make sense in some cases, but in most cases I think I'd rather let chronyd to select for synchronization the best servers it has.

Running your own stratum 1 server(s) would be a good way to give chronyd something it would prefer automatically.

Comment 3 Fedora End Of Life 2018-02-20 15:27:58 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 4 Miroslav Lichvar 2018-02-27 10:33:39 UTC
As nobody seems to be objecting to keeping the default options for NTP servers from DHCP, I'm closing this bug.


Note You need to log in before you can comment on or make changes to this bug.