11 minutes mode in RHEL 8 and RHEL 9

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9

Issue

  • In RHEL8/9, timedatectl can not be used to check 11 minutes mode is on and working or not.
  • Command timedatectl reports "System clock synchronized: yes" even if "rtcsync" is commented in /etc/chrony.conf.
[root@vm80 etc]# grep rtc /etc/chrony.conf
#rtcsync
[root@vm80 etc]# timedatectl
               Local time: Tue 2020-01-21 15:45:55 JST
           Universal time: Tue 2020-01-21 06:45:55 UTC
                 RTC time: Tue 2020-01-21 06:45:54
                Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes       <===
              NTP service: active
          RTC in local TZ: no

Resolution

The best way to confirm the 11 minutes mode is working is to set the RTC few seconds off, e.g. by running

# hwclock --set --date '10 sec'

and then check after 11 minutes whether the RTC time and local time reported by timedatectl match.

If user just needs to check whether chronyd has marked the system clock as synchronized (expecting the kernel to perform the 11-minute sync), run the following command after installing strace and linuxptp:

# strace phc_ctl CLOCK_REALTIME freq |& grep adjtime

If it doesn't print STA_UNSYNC in the status field and the last value is not TIME_ERROR, the kernel should be updating the RTC.

However, the earlier kernel of RHEL 8 is less reliable than older version, it may take a very long time to actually set the RTC due to the inaccurate timing of the update. The issue has been fixed in kernel-4.18.0-348.el8.

Root Cause

  • On RHEL8, systemd-timedated was replaced with timedatex, which reports "System clock synchronized" even if the 11-minute RTC update is disabled, specifically to support chronyd without rtcsync.
  • On RHEL 9, timedatex is removed. But the behavior remains the same as RHEL 8.
  • The unreliable RTC synchronization issue was reported in bug 1793880, it has been fixed in kernel-4.18.0-348.el8.
  • RTC synchronization (11-minute mode) doesn't work on KVM even with kernel-4.18.0-348.el8 or later. Refer to RTC synchronization (11-minute mode) doesn't work on KVM.
Components

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.