FS#32976 - Kernel won't synchronize RTC with NTPD enabled

Attached to Project: Arch Linux
Opened by Alex (usovalx) - Wednesday, 05 December 2012, 17:27 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 06 December 2012, 13:26 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To Dave Reisner (falconindy)
Tom Gundersen (tomegun)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
From what I understand when NTPd is running, it should activate 11 minute mode in the kernel to synchronize RTC to system clock. For some reason it's not happening on my machine.

Here are two snapshots from timedatectl. Notice the difference between UTC & RTC:
Local time: Wed, 2012-12-05 16:54:03 GMT
Universal time: Wed, 2012-12-05 16:54:03 UTC
RTC time: Wed, 2012-12-05 16:54:03
Timezone: Europe/London
UTC offset: +0000
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no

and some time later:
Local time: Wed, 2012-12-05 17:23:47 GMT
Universal time: Wed, 2012-12-05 17:23:47 UTC
RTC time: Wed, 2012-12-05 17:24:06
Timezone: Europe/London
UTC offset: +0000
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no

time_status in kernel (as reported by adjtimex -p):
mode: 0
offset: 249117
frequency: -323947
maxerror: 56780
esterror: 1716
status: 8193
time_constant: 6
precision: 1
tolerance: 32768000
tick: 10000
raw time: 1354728301s 385157115us = 1354728301.385157115





Additional info:
* package version(s)
* config and/or log files etc.

Kernel: 3.6.9-1-ARCH #1 SMP PREEMPT Tue Dec 4 08:04:10 CET 2012 x86_64 GNU/Linux
NTPD: 4.2.6.p5-11
This task depends upon

Closed by  Dave Reisner (falconindy)
Thursday, 06 December 2012, 13:26 GMT
Reason for closing:  Not a bug
Comment by Alex (usovalx) - Thursday, 06 December 2012, 10:31 GMT
One simple solution would be to resurrect hwclock [ FS#31674 ] to update RTC on shutdown.
Comment by Dave Reisner (falconindy) - Thursday, 06 December 2012, 11:11 GMT
No, not a solution. Not even a workaround.

Your adjtimex output shows a status of 8193, which is STA_PLL & STA_NANO, the former of the two being what enables 11 minute mode (the latter is just an RO attribute describing the resolution).

My understanding is that 11 minute mode only updates the RTC. It has nothing to do with sync'ing the system time from the RTC. Is this "machine" a physical boxen or something else?
Comment by Tom Gundersen (tomegun) - Thursday, 06 December 2012, 11:33 GMT
Fwiw, more readable output is given by datetimectl.


Notice that 11 minute mode is only enabled when ntpd has fully synced the system time.

Also, note that system time is never written to the RTC, even if 11 minute mode is enabled if the two clocks differ by more than fifteen minutes. Use timedatectl to set the RTC once manually if this it's the case.

Someone should teach the kernel to ignore this 15 minutes hack...
Comment by Alex (usovalx) - Thursday, 06 December 2012, 11:48 GMT
It's a physical box.

Now that you mention it, my problem might have been caused by 15 minutes limit.
This box was windows workstation up until recently, and my RTC was off by 1 hour.

I have set RTC manually to be few minutes off and restarted NTPd.
I will re-check in about an hour from now whether kernel has properly synchronized it.
Comment by Alex (usovalx) - Thursday, 06 December 2012, 12:04 GMT
It seems to work now.
It makes me wonder what I was doing wrong yesterday, because I have tried the very same scenario.

Loading...