Time is not adjusted by a leap second when ntpd runs with -x option
Environment
- Red Hat Enterprise Linux 5
- ntp-4.2.2p1-8 and earlier
Issue
- Time is not adjusted by a leap second when ntpd runs with -x option. This is different from the behavior discussed in Resolve Leap Second Issues in Red Hat Enterprise Linux
.
Resolution
To resolve this issue, update to ntp-4.2.2p1-9 or later per Errata RHBA-2009:0125-6.
Root Cause
-
A known issue (Red Hat Bug This content is not included.431729) prevented ntpd's slew mode from being applied properly.
-
With Slew mode enabled the kernel time discipline is disabled, which is what will allow ntp to slew the leap second instead of applying it immediately. Note the following regarding disabling the kernel discipline regarding the leap second, from Content from www.ntp.org is not included.NTP in real life: What happens during a leap second:
- If the operating system does not implement the kernel discipline, the clock will show an error of one second relative to NTP's time immediate after the leap second.
- The situation will be handled just like an unexpected change of time: The operating system will continue with the wrong time for some time, but eventually ntpd will step the time.
- Effectively this will cause the correction for leap seconds to be applied too late.
-
In addition, the following note, from ntpd's man page, explains slew mode:
-x Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment as much as 600 s will take almost 14 days to complete. This option can be used with the -g and -q options. See the tinker command for other options. Note: The kernel time discipline is disabled with this option.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.