Tech Support > Operating Systems > Linux / Variants > Linux startup messes clock up
Linux startup messes clock up
Posted by Markus Kohler on January 27th, 2004


Hi,

here what I have

SuSE 9.0, kernel 2.4.21, ACPI, APM enabled, ASUS PL Deluxe Mainboard
(dual pentium)

Symptom: After booting Linux I have some random time in the clock even
after just having set the clock in the BIOS.

I first thought the batterie was gone/defect (though it's a new
mainboard). Problem remains after having inserted a new batterie.

Is there a (known) hardware defect on the ASUS Mainboard, is there a
BIOS defect or is it a problem with ACPI/APM?

Any suggestions how I could track down the problem are appreciated.
Please also mail a copy to markus.kohler@uni-dortmund.de.

Cheers,
Markus

Posted by Rod Smith on January 27th, 2004


Markus Kohler wrote:

I don't know what the cause is, but if the system is always connected to
the Internet, one possible band-aid solution is to run an NTP server on
the system. It'll contact an NTP time source on the Internet and set the
time correctly, hopefully overcoming whatever's causing the problem.

OTOH, it occurs to me that it's conceivable that a malfunctioning NTP
server could be causing the problem, particularly if your system isn't
always connected to the Internet. It could be getting confused when it
can't contact a good time source, and set the time to a seemingly random
value. This SHOULDN'T happen, but it's at least conceivable that it
would. If so, removing the NTP server (probably installed from a package
called ntp or xntp) should fix the problem.

--
Rod Smith, rodsmith@rodsbooks.com
http://www.rodsbooks.com
Author of books on Linux, FreeBSD, and networking

Posted by David Douthitt on January 27th, 2004


On 27 Jan 2004 03:37:48 -0800, kohler@ls7.cs.uni-dortmund.de (Markus
Kohler) wrote:

You probably already know this, but for reference....

There are two times in Linux. There is the hardware clock, and the
system clock. The Linux system clock is normally set at bootup from
the hardware clock.

Note too, that the hardware clock is often set as part of the
shutdown.

I'd use hwclock to see what it thinks the hardware clock is set to.
Try this command:

hwclock --show

Remember that it won't show you whether you are using UTC or not. If
you're in Germany, you'd be GMT+0 probably?

Is it possible that your clock is unreadable by Linux?

In any case, you should run NTP if you can - it will set the time from
the Internet using NTP on bootup, then will set the hardware clock to
the correct time.

You can disable ACPI with a kernel parameter "noacpi"; I believe (but
can't say for sure) that "noapm" may also work.


David Douthitt (david@douthitt.net)
UNIX System Administrator
HP-UX, Unixware, Linux
Linux+, LPIC-1

Posted by Jean-David Beyer on January 27th, 2004


Markus Kohler wrote:
This should be in the FAQ by now.

When booting Linux, most distributions read the hardware (CMOS) clock
and then use the system clock (address in memory) to keep track of the time.

When shutting down Linux, most distributions set the hardware (CMOS)
clock to the value in the system clock.

Meanwhile, back at the ranch, file /etc/adjtime is used to keep track of
the slippage between the hardware clock and the system clock. If you
really screw up that file (e.g., by moving from one time zone to
another), it will take forever (it seems) to get the correction factor
to be correct.

I suggest deleting /etc/adjtime. Then reboot a couple of times, and
everything should be OK. It will create a new /etc/adjtime. Mine looks
like this at the moment:

valinux:jdbeyer[/etc]$ cat adjtime
-4.465332 1075025095 0.000000
1075025095
UTC


--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ Registered Machine 73926.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 2:25pm up 21 days, 1:50, 2 users, load average: 2.21, 2.21, 2.12


Posted by Markus Kohler on January 28th, 2004


Hi there,

thanks to everyone who answered. Well I will check all the things you
mentioned. However, I have a dialup connection and so it is very
annoying (for CVS) if I start working and the clock is screwed. I will
check, whether ntp is running and doing this "bad" job trying to set
the clock although there's no internet connection. I do not think that
the /etc/adjtime is screwed, because I have never ever touched that
file or done any "special" treatment to the clock/time. When I
installed the hw system, I just said, that the clock has local time
etc. As said: first I thought the battery was gone (although new, but
still it can happen) because the times that I get after a startup are
so random, sometimes 1999, sometimes 2003, sometimes 2099, sometimes
1978... I have never had this with a Linux box before. Because
ACPI/APM read/write the BIOS I thought it might have been a problem of
the BIOS of this specific mainboard and ACPI/APM.

Strange things happen in this world...

Thanks again, I'll check /etc/adjtime and ntp and maybe there is
something with acpi/apm?

Markus


Jean-David Beyer <j@d.b> wrote in message news:<4016BC91.60204@d.b>...


Similar Posts