[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: NTP / RTC problem driving me absolutely INSANE!



OK, It looks like your hardware clock (as you properly call RTC) is wrongly set to BST (British for "Daylight Savings Time") probably because you did your MacOS-X install in the Summer. That's pretty easily fixed.

Boot into MacOS-X. Disable ntp using the system preferences gui. Then, make sure your Timezone is set to Europe/London. and, if you can, tell it that your are *not* currently in Daylight Savings Time (MacOS-X may not need that -- I don't remember. If not, it doesn't matter.) Make sure you do things in the specified order. Do not reset the clock. MacOS-X will probably think the time is one hour off from what your watch says. Ignore it for the time being.

Next, running Linux, first make sure your system clock (the software one maintained by the kernel) is OK. If NTP seems to be happy and the date command gives reasonable output (including the timezone part). You're probably OK there.

Next, as superuser, type the following at the bash prompt:
	mv -i /etc/adjtime /etc/adjtime.SAVE
	hwclock --utc --systohc
	clock ; date
Now your RTC and software clock are synchronized. Your hardware clock and kernel clock are set to UTC and your local timezone is set to Europe/London, because your haven't changed that. When Summer rolls around, your hardware clock and kernel clock will still be in UTC, but the date display libraries (as used by the "date" command) will adjust for Daylight Savings, and display BST.

Then, back in MacOS-X, use the system preferences gui to make sure your timezone is still set to Europe/London, and the system's idea of time corresponds to your watch. If so, re-enable NTP. If not. Something else is wrong and we'll have to dig further.

Enjoy!

Rick


On Feb 10, 2007, at 3:02 AM, Ananda Samaddar wrote:

Thanks for the help this is what the command you suggested gave:

Sat Feb 10 07:50:29 UTC 2007
time in rtc is Sat Feb 10 08:50:30 2007
Sat Feb 10 08:50:30 2007

So I'm guessing that it's down to Debian making a mess of things and not OSX. OSX must read the RTC see that it's an hour too fast and correct it. To be honest I really don't know where to go from here and do require a bit of hand holding. To think I used Debian for 5 and Ubuntu for 2 years on X86! So the RTC is one hour two fast according to the command output. Why doesn't Debian adjust the value of the RTC? I'm sorry but I'm a bit baffled and need a hand. Tzconfig tells me I'm set to Europe/London which is right. Why doesn't Debian just set up time by checking the RTC at boot up. It's obviously not changinging the RTC on reboot / shutdown because if I was to boot into OSX now with the RTC one hour two fast OSX would recognise it. I've just checked and all the scripts for hwclock are symlinked correctly too. I also have rtc support in the kernel, which is custom compiled. But the kernel does say that if fails to access rtc0.

Sorry this has been a bit of a rambling message that I hope makes some sense. Any further advice much appreciated.

regards,

Ananda


On Sat, 10 Feb 2007 02:39:20 -0500
Rick Thomas <rbthomas55@pobox.com> wrote:

It sounds like a timezone problem.  It could be one or both of two
things:

1) Your hardware CMOS clock is set to something other than UTC or
local time.  For Linux, it must be one or the other -- UTC is
preferable.

In Linux as super-user, at the bash prompt type "(export TZ=UTC ;
date ; clock)" (without the quotes, but with the parens).
The three times it prints should be identical and equal to the
present time in UTC.  If, as seems likely, you're in GB and "Summer
Time" is not in effect, then it should also be the same as your local
time.

2) Either MacOS or Linux has the wrong timezone.  My guess (assuming
you're in GB) is that one or the other is set to BST, even though it
is manifestly *not* summer in the Northern Hemisphere right now.

Hope that helps!


Rick



On Feb 9, 2007, at 7:56 PM, Ananda Samaddar wrote:

Hello everyone,

by now you're probably mostly familiar with the trials and
tribulations I faced moving to a new architecture but there is one
thing that is really annoying me!

I have NTPD running synced to four servers here in the UK and one
in France which works fine.  The correct time is shown and
everything's ok.  The problem is when I boot to OSX it always shows
the time as being one hour behind and corrects it.  Fair enough.
If I then reboot into Debian it shows the time to be one hour
ahead.  You'd think that NTP would just correct the time
accordingly.  It does but if I'm logged into GNOME which I use as
the desktop it blanks the screen and no matter what I try I cannot
get back to GNOME or a console terminal.  If I reboot after OSX and
log into a terminal while I'm using the terminal GDM informs me
that the greeter (the default Etch one) is crashing and changes it
to the old school one from Potato! The only solution is a hard reset.




Reply to: