当某些与时间相关的程序(如ntpd
)在Linux系统上运行时,内核将切换到所谓的“11分钟模式”(参见hwclock
手册页),它将每11分钟从系统时钟中自动更新硬件时钟。
在SLES11上,我根据经验确定,如果我将硬件时钟设置为系统时钟后大约10小时的时间,那么11分钟的模式似乎无法使硬件时钟与系统时钟匹配。但是如果我把硬件时钟设置在系统时钟后面5分钟,11分钟模式就完美匹配了。
所以很明显,11分钟模式可以处理一些最大的更新,我想知道它是什么。
这很奇怪..。
更多实验表明,当HW时钟在系统时钟后面20分钟左右时,11分钟模式将HW时钟设置为系统时钟后30分钟(!):
# date
Tue Dec 6 10:16:52 EST 2011
# hwclock --set --date "12/6/11 09:56"
#
# date
Tue Dec 6 10:17:16 EST 2011
# hwclock --show
Tue Dec 6 09:56:06 2011 -0.156551 seconds
#
# date
Tue Dec 6 10:23:09 EST 2011
# hwclock --show
Tue Dec 6 10:01:58 2011 -0.535772 seconds
#
# date
Tue Dec 6 10:34:28 EST 2011
# hwclock --show
Tue Dec 6 10:04:27 2011 -0.192025 seconds
我遇到了这样的情况:https://bugs.archlinux.org/task/27408,它确实意味着当硬件时钟时间离系统时钟时间太远时,内核不会更新硬件时钟。
发布于 2012-01-18 17:06:46
来自RHEL4.6上的hwclock
手册页:
This mode (we'll call it "11 minute mode") is off until something turns it on. The ntp
daemon xntpd is one thing that turns it on. You can turn it off by running
anything, including hwclock --hctosys, that sets the System Time the old fashioned way.
To see if it is on or off, use the command adjtimex --print and look at the value of
"status". If the "64" bit of this number (expressed in binary) equal to 0, 11 minute mode
is on. Otherwise, it is off.
因此,由于您运行hwclock --set
的优点,您可能已经关闭了它。同样,您可以检查adjtimex --print
的输出以确认。
发布于 2012-01-18 17:35:42
事实上,这与内核中的11分钟模式无关。这与ntpd中的特性有关。
你知道所谓的ntp的理智限度吗?如果时间太远(例如,10小时),ntpd就会放弃,而不会使时钟倾斜。在这些情况下,应该手动运行ntpd或ntpdate。-g
的Ntpd选项应该这样做。查看手册页中的信息:
http://doc.ntp.org/4.1.0/ntpd.htm
发布于 2017-09-14 12:44:14
内核将不会同步时间,如果它关闭超过60分钟时,在11分钟模式。这是SUSE中的一个常见问题,有关更多细节,请参阅Open中的本文:https://lists.opensuse.org/opensuse-bugs/2011-06/msg01348.html
https://serverfault.com/questions/337930
复制相似问题