On 2010-07-07 22:36 GMT mchnz wrote:
>
> My system was powered down at daylight savings changeover. Like many
> Linux users, I keep my RTC on local time so that I can still boot XP
> on the odd occasion.
I understand that by RTC you mean the “cmos clock”.
> With my older Linux distros, ntpd would correct the system time during
> the next boot, and the altered system time would be copied to the RTC
> on shutdown (by hwclock).
The correction should happen without recourse to ntp. Actually, if time
is to bad at that moment, weird things can happen. As you are seeing.
And notice that Windows has its own ideas and will (may) adjust to the
daylight change - again.
> This no longer seems to happen. During boot, ntpd corrects the
> system-time, and the users sees the right time, but the corrected time
> is never copied to the RTC. The issue only becomes a problem if the
> system is booted without access to any ntp servers - in which case the
> system time is visible uncorrected.
The cmos clock is only updated when the system is halted correctly -
but as there was a time-jump, that time jump will distort the
calculations when you boot again.
> I was under the impression that the kernel’s 11-minute save-RTC mode
> should preserved any NTP corrected system-time to the RTC. And
> failing that, a shutdown triggered hwclock --systohc should have also
> corrected the RTC. How come neither work for openSUSE (11.2)?
No, that cyclic update is not done in oS, never has, AFAIK.
And the shutdown technique doesn’t work because there was a time jump.
Ok, the sequence to correctly setup the hour is:
-
correct the clock by using ntp or the command “date something” as
root.
-
update the cmos clock (hwclock --systohc)
-
remove the file keeping track of cmos adjustements,
ie, /etc/adjtime, then update the cmos again:
cat /etc/adjtime (watch to see if it says UTC or local)
rm /etc/adjtime
hwclock --systohc --utc|–localtime
Verify both clocks:
date
hwclock
That should be it.
> Another issue is that having initially booted without an internet
> connection, ntpd refuses to re-resolve the the ntp servers and has to
> be manually restarted. Shouldn’t ntpd have a roadwarrior option to
> retry resolving hosts? - this would save having to manually kick it
> via the command line or cron.
It might do, but very slowly. I’m unsure of that.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))