hwclock --systohc can hang on busy or virtual machine
Issue
- If the
hwclockcommand with the--systohcoption is not able to run continuously (without being interrupted for more than 100 ms) for at least 500 ms, it will never finish. This can occur on a machine that is busy or on a virtual machine where the physical CPUs are shared across a larger number of virtual CPUs.
The command
# sudo /sbin/hwclock --systohc -D
prints messages of following pattern:
Time elapsed since reference time has been 5.364920 seconds.
Delaying further to reach the new time.
and never terminates.
This causes a reboot or shutdown of a machine to effectively hang.
Additional info:
The design flaw in 2.17.2's hwclock that causes this problem was masked (not fixed!) by a bug introduced by a change made circa 2011-07-25. This ensures that it always terminates, but not correctly nor in the manner intended (nor was the intent of that change to fix the bug described above).
- We want to change the hwclock to the one as viewed on the
datecommand.
Environment
- Red Hat Enterprise Linux 6.4
- util-linux-ng 2.17.2, util-linux 2.20.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.