Bug 1003164

Summary: chrony doesn't respect OpenVPN NTP-server pushed option
Product: [Fedora] Fedora Reporter: Vladislav Grigoryev <vg.aetera>
Component: NetworkManager-openvpnAssignee: Dan Williams <dcbw>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 19CC: choeger, darren.armstrong, dcbw, huzaifas, mlichvar, steve, thaller, vg.aetera
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-17 17:00:21 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:

Description Vladislav Grigoryev 2013-08-31 11:01:55 UTC
Description of problem:
chrony doesn't respect OpenVPN NTP-server pushed option.
For example in server config:
push "dhcp-option NTP 192.168.8.254"

Version-Release number of selected component (if applicable):
chrony-1.29-1.fc19.x86_64
NetworkManager-0.9.8.2-8.git20130709.fc19.x86_64
NetworkManager-openvpn-0.9.8.2-3.fc19.x86_64
NetworkManager-openvpn-gnome-0.9.8.2-3.fc19.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Add to the OpenVPN-server configuration:
push "dhcp-option NTP 192.168.8.254"
2. Reconnect to the server.

Actual results:
Another NTP-server is used as "Selected source" in
journalctl _SYSTEMD_UNIT=chronyd.service

Expected results:
Respect OpenVPN NTP-server pushed option.

Comment 1 Vladislav Grigoryev 2013-08-31 11:23:30 UTC
Additional info:
Using external NTP-server source while being connected to untrusted network could lead to potential security issues.
That's why it's important to respect OpenVPN NTP-server option.

Comment 2 Miroslav Lichvar 2013-09-02 09:55:51 UTC
Is the server present in "chronyc -n sources" output?

The chrony package includes /etc/dhcp/dhclient.d/chrony.sh to configure chronyd to use the NTP servers from dhclient. It should be run by NetworkManager dispatcher script /etc/NetworkManager/dispatcher.d/11-dhclient.

Comment 3 Miroslav Lichvar 2013-10-03 10:02:45 UTC
To me it looks like NetworkManager doesn't have the NTP servers from openvpn or it doesn't export it for the dhclient dispatcher script. Reassigning to NetworkManager-openvpn, its maintainers will probably know better where the problem is.

Comment 4 Vladislav Grigoryev 2013-10-06 16:10:16 UTC
(In reply to Miroslav Lichvar from comment #2)
> Is the server present in "chronyc -n sources" output?

No, it isn't.

(In reply to Miroslav Lichvar from comment #2)
> The chrony package includes /etc/dhcp/dhclient.d/chrony.sh to configure
> chronyd to use the NTP servers from dhclient. It should be run by
> NetworkManager dispatcher script
> /etc/NetworkManager/dispatcher.d/11-dhclient.

I also have options
push "dhcp-option DOMAIN example.org"
push "dhcp-option DNS 192.168.8.254"
and it is applied correctly, so suggest that dhclient script works.

(In reply to Miroslav Lichvar from comment #3)
> To me it looks like NetworkManager doesn't have the NTP servers from openvpn
> or it doesn't export it for the dhclient dispatcher script. Reassigning to
> NetworkManager-openvpn, its maintainers will probably know better where the
> problem is.

Apparently you are right.

Comment 5 Darren 2013-10-31 22:21:19 UTC
Yes I think NM is working fine as if I rm -f /var/lib/dhclient/chrony.* and then systemctl restart NetworkManager I get cat /var/lib/dhclient/chrony.servers.eth0 with a valid address.
I need to check what openvpn actually does. I have selinux disabled and re-tested with the firewall disabled and it still does not work.
if I bash -x /usr/libexec/chrony-helper add-dhclient-servers
+ chronyc=/usr/bin/chronyc
+ dhclient_servers='/var/lib/dhclient/chrony.servers.*'
+ dhclient_added_servers=/var/lib/dhclient/chrony.added_servers
+ service_name=chronyd.service
+ case "$1" in
+ add_dhclient_servers
+ shopt -s nullglob
+ servers_files=($dhclient_servers)
+ shopt -u nullglob
+ ((  1  ))
++ cat /var/lib/dhclient/chrony.added_servers
++ read server serverargs
++ cat /var/lib/dhclient/chrony.servers.eth0
++ chrony_command 'add server 10.248.4.14 '
++ read server serverargs
+ added_servers=
+ update_dhclient_added_servers ''
++ sort -u
++ echo ''
+ new_servers=
++ cat /var/lib/dhclient/chrony.added_servers
+ old_servers=
+ '[' '' = '' ']'
+ return 0
+ exit 0
The added_servers= is empty whereas with 1.27 chrony the added_servers=10.248.4.14.


To add confusion if I upgrade from a working 1.27 to 1.29 and delete the dhclient files and restart NM and chrony the system works. Could chrony.keys have anyrhing to do with it?
Note the PC is a kickstart image from a cobbler server (time server) using the latest FC18 packages. So downgrading to 1.27 and then going back to 1.29 seems to fix whatever is going wrong.

Comment 6 Darren 2013-10-31 22:24:43 UTC
(In reply to Darren from comment #5)
Sorry I added this to the wrong bug. Please delete.

> Yes I think NM is working fine as if I rm -f /var/lib/dhclient/chrony.* and
> then systemctl restart NetworkManager I get cat
> /var/lib/dhclient/chrony.servers.eth0 with a valid address.
> I need to check what openvpn actually does. I have selinux disabled and
> re-tested with the firewall disabled and it still does not work.
> if I bash -x /usr/libexec/chrony-helper add-dhclient-servers
> + chronyc=/usr/bin/chronyc
> + dhclient_servers='/var/lib/dhclient/chrony.servers.*'
> + dhclient_added_servers=/var/lib/dhclient/chrony.added_servers
> + service_name=chronyd.service
> + case "$1" in
> + add_dhclient_servers
> + shopt -s nullglob
> + servers_files=($dhclient_servers)
> + shopt -u nullglob
> + ((  1  ))
> ++ cat /var/lib/dhclient/chrony.added_servers
> ++ read server serverargs
> ++ cat /var/lib/dhclient/chrony.servers.eth0
> ++ chrony_command 'add server 10.248.4.14 '
> ++ read server serverargs
> + added_servers=
> + update_dhclient_added_servers ''
> ++ sort -u
> ++ echo ''
> + new_servers=
> ++ cat /var/lib/dhclient/chrony.added_servers
> + old_servers=
> + '[' '' = '' ']'
> + return 0
> + exit 0
> The added_servers= is empty whereas with 1.27 chrony the
> added_servers=10.248.4.14.
> 
> 
> To add confusion if I upgrade from a working 1.27 to 1.29 and delete the
> dhclient files and restart NM and chrony the system works. Could chrony.keys
> have anyrhing to do with it?
> Note the PC is a kickstart image from a cobbler server (time server) using
> the latest FC18 packages. So downgrading to 1.27 and then going back to 1.29
> seems to fix whatever is going wrong.

Comment 7 Fedora End Of Life 2015-01-09 19:40:13 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2015-02-17 17:00:21 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.