[Bug 699400] New: Hardware clock never set on shutdown when ntp is active
https://bugzilla.novell.com/show_bug.cgi?id=699400 https://bugzilla.novell.com/show_bug.cgi?id=699400#c0 Summary: Hardware clock never set on shutdown when ntp is active Classification: openSUSE Product: openSUSE 12.1 Version: Factory Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: seife@novell.slipkontur.de QAContact: qa@suse.de CC: werner@novell.com Found By: Third Party Developer/Partner Blocker: --- (This bug is also in 11.4) During shutdown, I always only see The System Time is in sync with Hardware Clock and hwclock is not set. The problem is IMHO in the ELEVENMIN_MODE code in /etc/init.d/boot.clock This test machine has a hw clock which is 1 hour off. For testing, I disabled ntp. strolchi:~ # adjtimex --print | grep status status: 64 In this case, ELEVENMIN_MODE == no and the clock is set on shutdown. Now I start ntp: strolchi:~ # /etc/init.d/ntp start 10 Jun 23:52:42 sntp[2883]: Started sntp 2011-06-10 23:52:42.303197 (-0100) -3599.902140 +/- 0.046265 secs Time synchronized with ntp.home.s3e.de Starting network time protocol daemon (NTPD) done strolchi:~ # adjtimex --print | grep status status: 8193 Now, ELEVENMIN_MODE == yes and the clock setting code is skipped on shutdown. So with the hwclock 1 hour off, this always leads to time warps during boot and th e hwclock is never corrected. I don't really understand the ELEVENMIN_MODE code, but it does not look too helpful. strolchi:~ # grep -v ^# /etc/sysconfig/clock HWCLOCK="-u" SYSTOHC="yes" TIMEZONE="Europe/Berlin" DEFAULT_TIMEZONE="US/Eastern" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c1
Stefan Seyfried
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c
zj jia
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c2
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c3
Stefan Seyfried
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c4
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c5
Stefan Seyfried
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c6
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c7
--- Comment #7 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c8
Stefan Seyfried
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c9
--- Comment #9 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c10
--- Comment #10 from Stefan Seyfried
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c11
--- Comment #11 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c12
Robert Davies
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c13
--- Comment #13 from Robert Davies
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c14
--- Comment #14 from Robert Davies
Normally the CMOS clock is set only once to UTC and all works flawless. Setting the CMOS clock to localtime is a user error (and IMHO we should not support this anymore as Windows7[tm] can handle UTC im CMOS).
For broken hardware you loose as there is no chance to correct anything.
I tested Windows 7 running with UTC, as it is my preference. The problem is it is not acceptable to users, because the time shown "localtime" is then UTC, with additional clock in true localtime. Setting Windows local time clock to Europe/London GMT/BST wiith DST and "additional clock" to be UTC, causes the out by an hour problem!! MS HAVE not properly supported, system clock in UTC BUT insist in doing DST, and non DST adjustment means it's not localtime. sntp -s on boot, did indeed fix up the Linux clock, as well as CMOS clock and allow NTP to operate & synchronise from there on. No 11 minute mode, if it's done before the NTP daemon is even started. Frankly I cannot see why, an "sntp -s" with 2 or 3 defined servers, is not simply done on boot anyway, the CMOS clock is not nearly as accurate as NTP protocol. Doing that EVERY time simplifies the rcntp script to. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c15
--- Comment #15 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c16
--- Comment #16 from Robert Davies
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c17
--- Comment #17 from Stefan Seyfried
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c18
--- Comment #18 from Robert Davies
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c19
--- Comment #19 from Ruediger Oertel
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c20
--- Comment #20 from Robert Davies
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c21
--- Comment #21 from Robert Davies
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c29
--- Comment #29 from Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c30
--- Comment #30 from Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c31
--- Comment #31 from Jochen Roeder
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c34
--- Comment #34 from Ruediger Oertel
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c35
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c36
Jochen Roeder
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c37
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c38
Archie Cobbs
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c39
--- Comment #39 from Stefan Seyfried
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c40
--- Comment #40 from Dr. Werner Fink
The bug, as pointed out earlier, is in /etc/init.d/boot.clock's assumption that 11-minute mode implies accurate hardware clock... this is wrong!
If the kernel is in the 11-minute mode than the CMSO clock is accurate that is touching the CMOS clock with hwclock does not increase the accuracy but making it worse (sigh!). The only problem with that is: if the CMOS clock is off by more than 15 minutes the kernel does not touch the CMOS clock anymore due to the fact that this could be an other timezone than UTC. A more correct solution would be a) Correct the CMOS clock before starting ntp (see bug #730374) this already part of stable/openSUSE_Factory b) Modify the 11-minute mode check by not only using the status bit but also compare the current CMOS clock with the system clock. c) both a) and b) (In reply to comment #39) @Seife: It would be more powerful if you could think deeper into the problem and help to avoid such ``solutions''. It is a matter of fact that is the kernel is in 11-minute mode the user space program like hwclock using a system call can not increase accuracy. That is that such a ``solutions'' will break any correct configured system. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c41
--- Comment #41 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c42
--- Comment #42 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c43
--- Comment #43 from Archie Cobbs
In bash code the point b) could look like ...
Yes, option (b) makes the most sense to me as well. Can we get that added? Does somebody need to create a new feature request? Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c44
--- Comment #44 from Stefan Seyfried
E.g. for more information see `man 8 hwclock' at section:
Automatic Hardware Clock Synchronization By the Kernel [...] If your system runs with 11 minute mode on, don't use hwclock --adjust or hwclock --hctosys. You'll just make a mess. It is acceptable to use a hwclock --hctosys at startup time to get a reasonable System Time until your system is able to set the System Time from the external source and start 11 minute mode.
During system shutdown, keeping the kernel internal view of the clock accurate is probably less important than making sure that the clock is at least in the correct century on next reboot. I have updated my blog post with your annotation that this method is totally wrong (and added my evidence from running > 2000 servers with this hack which work fine only since we use this). If we get a proper solution now, this is also fine. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c45
Andrew Chace
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c46
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=699400
https://bugzilla.novell.com/show_bug.cgi?id=699400#c47
--- Comment #47 from Archie Cobbs
participants (1)
-
bugzilla_noreply@novell.com