Bug 1726671

Summary: timedatectl shows NTP synchronized: no, while with ntpstat the server is synchronized
Product: Red Hat Enterprise Linux 7 Reporter: Yogita <ysoni>
Component: systemdAssignee: David Tardon <dtardon>
Status: CLOSED DUPLICATE QA Contact: Frantisek Sumsal <fsumsal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.8CC: dtardon, kwalker, mmezynsk, systemd-maint-list, thozza
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-10 19:12:48 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 Yogita 2019-07-03 11:42:38 UTC
Description of problem:
Customer is running their environment the ntpd in "slew" mode (ntpd -x). With running ntpd in "slew" mode, timedatectl does always show "NTP synchronized: no" while ntpstat correctly show "synchronised to NTP server (10.11.160.238) at stratum 2 "

Version-Release number of selected component (if applicable):
RHEL7.6 
systemd-219-62.el7.x86_64

How reproducible:
remove chrony package, install ntp package, configure ntpd to run in "slew" mode, wait some time to be synchronized, test timedatectl vs. ntpstat


Steps to Reproduce:
1. yum remove chrony
2. yum install ntp
3. vi /etc/sysconfig/ntpd and add -x at the end of the OPTIONS line -> OPTIONS="-g -x" 
4. systemctl enable ntpd.service
5. systemctl start ntpd.service / or / timedatectl set-ntp 1
6. *wait some time to be synchronized*
7. ntpstat
8. timedatectl | grep NTP

Actual results:
# timedatectl | grep NTP
     NTP enabled: yes
NTP synchronized: no

# ntpstat
synchronised to NTP server (10.11.160.238) at stratum 2 
   time correct to within 10 ms
   polling server every 64 s

# ps -wauxxx | grep ntp
ntp       4343  0.0  0.0  29944  2140 ?        Ss   11:33   0:00 /usr/sbin/ntpd -u ntp:ntp -g -x

Expected results:

# timedatectl | grep NTP
     NTP enabled: yes
NTP synchronized: yes

Additional info:
I reproduced the problem on RHEL7.6/7.5/7.3
Customer won't use chrony in the near future.
additional side note, there is another issue with ntpd running in "slew" mode, ntptime returns code 5 (ERROR) which is described in https://access.redhat.com/solutions/38542, which was leading me to the source of this timedatectl issue.

Note - This bugzilla case is re-opened with systemd component due to reason mentioned in Bug 1660846's comment #6

Comment 3 David Tardon 2019-07-03 14:12:34 UTC

*** This bug has been marked as a duplicate of bug 1660846 ***