RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1286969 - ntpstat reports synchronized even when the local ntpd doesn't synchronize with any time server.
Summary: ntpstat reports synchronized even when the local ntpd doesn't synchronize wit...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ntp
Version: 6.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Lichvar
QA Contact: Jakub Prokes
URL:
Whiteboard:
Depends On:
Blocks: 1309594
TreeView+ depends on / blocked
 
Reported: 2015-12-01 09:14 UTC by Masahiro Matsuya
Modified: 2019-09-12 09:26 UTC (History)
3 users (show)

Fixed In Version: ntp-4.2.6p5-9.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1309594 (view as bug list)
Environment:
Last Closed: 2016-05-10 20:17:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0780 0 normal SHIPPED_LIVE Moderate: ntp security and bug fix update 2016-05-10 22:35:43 UTC

Description Masahiro Matsuya 2015-12-01 09:14:38 UTC
Description of problem:

When ntpd starts, ntpstat reports 'unsynchronized' for a while. That's ok.
After a while, ntpd starts to sync with a time server, and ntpstat report 'synchronized'. That's ok as well.
A customer stopped the upper time servers, and ntpd lost all time servers to be synchronized. But, ntpstat keeps to report 'synchronized'.

They are going to check the status of ntpd with ntpstat command. So, their expectation is that ntpstat returns 1 (unsyncronized) when it lose all ones to be synchronized.

ntpstat checks the value of sys_leap in the local ntpd. If it's 0x11 (LEAP_NOTINSYNC), it reports unsynchronized. As far as I checked the ntp's souce code, the code to set LEAP_NOTINSYNC into sys_leap is the following only.

0 ntpd/ntp_proto.c 1717 sys_leap = LEAP_NOTINSYNC;  ## when step adjustment happen
2 ntpd/ntp_proto.c 2251 sys_leap = LEAP_NOTINSYNC;  ## N/A because LOCKCLOCK macro is not defined.
3 ntpd/ntp_proto.c 3586 sys_leap = LEAP_NOTINSYNC;  ## when ntpd starts.

So, it can be changed into LEAP_NOTINSYNC, only when a step adjustment happens.


Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7

How reproducible:
Always

Steps to Reproduce:
1. configure two ntp hosts (server and client) with RHEL6
2. configure the ntp client to refer to the ntp server
3. start ntpd on both and wait the sync status.
4. stop ntpd on the ntp server, and wait until the ntp client got the status of unsynchronized.
5. run ntpstat and check that it still reports synchronized.

Actual results:
ntpstat reports synchronized, after it loses all time server to be synchronized.

Expected results:
ntpstat can report unsynchronized, when it loses all time server to be synchronized.

Comment 9 Miroslav Lichvar 2015-12-07 15:48:05 UTC
The ntpstat man page has been modified to include:

When the synchronised state is reported, it means the system clock was updated at some point.  There is no timeout for this state.  It will stay there even when the source becomes unreachable and there are no other sources available. However, the reported accuracy will be slowly increasing, in the default ntpd configuration by 15 microseconds per second.

Comment 16 errata-xmlrpc 2016-05-10 20:17:47 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://rhn.redhat.com/errata/RHSA-2016-0780.html


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