Bug 1611 - running \'hwclock --systohc\' at shutdown may be wrong
Summary: running \'hwclock --systohc\' at shutdown may be wrong
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: initscripts (show other bugs)
Version: unstable
Hardware: all Linux
: P5 minor
Assignee: Dmitry V. Levin
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-24 17:34 MSK by Sergey Vlasov
Modified: 2003-08-25 15:18 MSD (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Vlasov 2002-11-24 17:34:48 MSK
\"/etc/rc.r/init.d/clock stop\" runs \"hwclock --systohc\" - 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 \"hwclock --systohc\" at shutdown and to enable \"hwclock --adjust\" 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 \"hwclock --adjust\" before \"hwclock --hctosys\" 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.