Bug 1611

Summary: running \'hwclock --systohc\' at shutdown may be wrong
Product: Sisyphus Reporter: Sergey Vlasov <vsu>
Component: initscriptsAssignee: Dmitry V. Levin <ldv>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P5    
Version: unstable   
Hardware: all   
OS: Linux   

Description Sergey Vlasov 2002-11-24 17:34:48 MSK
\&quot;/etc/rc.r/init.d/clock stop\&quot; runs \&quot;hwclock --systohc\&quot; - this happens at each system shutdown or reboot. However, this command updates /etc/adjtime with assumption that the user has set the correct time - which is most likely not the case. Because of this, properly adjusting the speed of the RTC hardware clock is impossible - any such adjustment will be broken by this RTC setting at reboot (because the system clock might not have the correct speed too).

This problem is significant if a time synchronization service (ntp) is not used (which is a very common situation).

I propose to add several configuration parameters to /etc/sysconfig/clock to disable running \&quot;hwclock --systohc\&quot; at shutdown and to enable \&quot;hwclock --adjust\&quot; at startup (which is recommended by the hwclock man page):

HWCLOCK_SET_AT_HALT=false disables setting the RTC time from the system time at shutdown or reboot.

HWCLOCK_ADJUST=true enables running \&quot;hwclock --adjust\&quot; before \&quot;hwclock --hctosys\&quot; at startup.

The default values may be HWCLOCK_SET_AT_HALT=true, HWCLOCK_ADJUST=false to keep the old behavior by default (to avoid breaking the existing configurations). However, on new installs it may be better to set the opposite parameters (if the GUI/console configuration frontends to set the time use hwclock correctly).
---

---

Comment 1 Dmitry V. Levin 2002-12-08 16:36:07 MSK
Implemented in initscripts-5.49-ipl46mdk, please check.
Comment 2 Dmitry V. Levin 2002-12-08 16:36:07 MSK
Implemented in initscripts-5.49-ipl46mdk, please check.
Comment 3 Dmitry V. Levin 2002-12-23 15:45:30 MSK
Should be fixed, reopen if not.
Comment 4 Dmitry V. Levin 2002-12-23 15:45:30 MSK
Should be fixed, reopen if not.