Bug 1910125

Summary: chrony is configured and documented as though CONFIG_RTC_SYSTOHC were enabled in the kernel
Product: Red Hat Enterprise Linux 7 Reporter: Dan Astoorian <djast>
Component: chronyAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED NOTABUG QA Contact: rhel-cs-infra-services-qe <rhel-cs-infra-services-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.9   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-01-04 13:40:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Astoorian 2020-12-22 18:31:36 UTC
Description of problem:
Hardware clock is not being kept synchronized.

Version-Release number of selected component (if applicable):
chrony-3.4-1.el7.x86_64

How reproducible:
Consistently

Steps to Reproduce:
1. Ensure chrony is running with the "rtcsync" option enabled in /etc/chrony.conf (as it is by default).
2. Run timedatectl; compare the system time with the RTC time.  (If necessary, manually set the RTC time a few seconds fast or slow, and wait: "rtcsync" is supposed to cause the kernel to correct the error within 11 minutes.)

Actual results:
RTC may drift significantly from the system time, notwithstanding the note in Chapter 3 of the System Administrators Guide that "the kernel automatically synchronizes the hardware clock to the system clock every 11 minutes."

Expected results:
RTC should not drift significantly from the system time when chrony is running with rtcsync enabled.

Additional info:
Red Hat Enterprise Linux 7/8 kernels appear to be built without the CONFIG_RTC_SYSTOHC option, which appears to be the mechanism which is supposed to keep the hardware clock synchronized with the system time when NTP is active.

If CONFIG_RTC_SYSTOHC is not going to be set in shipped kernels, a different mechanism should be used to keep the hardware clock synchronized (e.g., running hwclock during shutdown as Red Hat Enterprise Linux 6 did), and/or the documentation should be corrected to indicate that chrony's rtcsync directive has no effect when using default Red Hat Enterprise Linux kernels; it may or may not be prudent to change the chrony configuration to use rtcfile or a similar mechanism by default to manage hardware clock drift instead.

Similar issues may apply to the ntp package, and also to Red Hat Enterprise Linux 8.

Comment 2 Miroslav Lichvar 2021-01-04 13:40:29 UTC
The RHEL kernel is built with the CONFIG_GENERIC_CMOS_UPDATE option, which uses the legacy RTC support as opposed to the newer RTC class support, which has the CONFIG_RTC_SYSTOHC option.

If you don't see the RTC being updated every 11 minutes, it might be due to unreliable timing of the update. That is a kernel issue. For RHEL8, it is tracked in bug #1793880.