In Red Hat Enterprise Linux 4, slew mode does not prevent ntp from setting the kernel flag

Solution Unverified - Updated

Environment

  • Red Hat Enterprise Linux 4
  • ntp-4.2.0.a.20040617-12.el4
  • ntp configured in slew mode

Issue

  • In Red Hat Enterprise Linux 4, slew mode does not prevent the ntp from setting the kernel flag
[root@xxx ~]# ntptime | grep status
  status 0x11 (PLL,INS),
[root@xxx ~]# ps aux | grep ntp
ntp       6724  0.0  0.5 17544 5296 ?        SLs  10:57   0:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -x

Resolution

ntpd in Red Hat Enterprise Linux 4 sets the kernel flag even after starting the ntpd service in slew mode. This bug will not be fixed in Red Hat Enterprise Linux 4. Resetting the kernel flag using ntptime -s 0 will also not help; the kernel will still step the clock by one second

Update the kernel on Red Hat Enterprise Linx 4 system to kernel-2.6.9-89.EL or later which contains the fix for the issue mentioned in the System hangs on printing the leap second insertion message

If kernel upgrade is not possible due to other dependencies then follow the below workaround

  1. Prevent the ntpd service from starting on a reboot by executing the following command:

     chkconfig ntpd off
    
  2. Reboot the server before the leap second event

  3. Wait for the leap second event to pass by

  4. Start the ntpd service, and re-enable this service on a reboot:

     chkconfig ntpd on
    

Root Cause

  • ntpd in Red Hat Enterprise Linux (RHEL) 4 does not disable kernel discipline with -x in contrast to ntpd found in RHEL 5, RHEL 6, and RHEL 7, which disables the kernel discipline with -x.

Diagnostic Steps

1. ntp configured in slew mode

# ps aux | grep ntp
ntp       6641  0.0  0.5 17544 5296 ?        SLs  10:55   0:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -x

2. ntptime time output

ntptime 
ntp_gettime() returns code 1 (INS)
  time d93d2edb.1eab8000  Tue, Jun 30 2015 11:06:03.119, (.119804),
  maximum error 169544 us, estimated error 2534 us
ntp_adjtime() returns code 1 (INS)
  modes 0x0 (),
  offset -1632.000 us, frequency -1.139 ppm, interval 4 s,
  maximum error 169544 us, estimated error 2534 us,
  status 0x11 (PLL,INS),
  time constant 2, precision 1.000 us, tolerance 512 ppm,
  pps frequency 0.000 ppm, stability 512.000 ppm, jitter 200.000 u
SBR
Components
Category

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.