Bug 1286969 - ntpstat reports synchronized even when the local ntpd doesn't synchronize with any time server.
ntpstat reports synchronized even when the local ntpd doesn't synchronize wit...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ntp (Show other bugs)
6.6
All Linux
medium Severity medium
: rc
: ---
Assigned To: Miroslav Lichvar
Jakub Prokes
:
Depends On:
Blocks: 1309594
  Show dependency treegraph
 
Reported: 2015-12-01 04:14 EST by Masahiro Matsuya
Modified: 2016-05-10 16:17 EDT (History)
3 users (show)

See Also:
Fixed In Version: ntp-4.2.6p5-9.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1309594 (view as bug list)
Environment:
Last Closed: 2016-05-10 16:17:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Masahiro Matsuya 2015-12-01 04:14:38 EST
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 10:48:05 EST
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 16:17:47 EDT
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.