You are not logged in.

#1 2011-04-10 18:15:21

RobertMe
Member
From: The Netherlands
Registered: 2010-07-04
Posts: 45

[Probably solved] Setting clock fails during boot (wrong time)

Hi,

I'm having a problem with the time being wrong after every boot. The time seems to shift both to the future as to the past (date now displays "Sun Apr 10 14:23:06" while the time should be 19:56 (date is right), but I think it also moved to the future, so I had a mount/fsck failure due to the last mount time being in the future (more than a day), but this could be a mistyped date with the date command, which I use to set the clock again).

After a shutdown the clock in the BIOS displays the right time, so the problem has to happen during the boot. So I started fiddling in the /etc/rc.sysinit file and found the cause to be in the second hwclock run (which is displayed as being "Configuring System Clock"), when I comment the "/sbin/hwclock --adjust" line after a reboot everything is fine. When I manually run hwclock --adjust the hardware clock is wrong again (according to hwclock --show). I'm not known with the workings of hwclock, but after reading the man page it seems to need a /etc/adjtime file, but this file is missing on my system. Also after running "hwclock --set --date=...." it isn't getting created. Could the absent of this file be the cause of my problems? (I don't think so, because it isn't being listed as part of the util-linux package (or tarball, for that matter))

Does anybody have some more clues about this strange problem?
Thanks in advance

Last edited by RobertMe (2011-04-11 17:21:32)

Offline

#2 2011-04-10 20:12:06

shulamy
Member
From: israel
Registered: 2010-09-11
Posts: 454

Re: [Probably solved] Setting clock fails during boot (wrong time)

i had the same problem with ntpd,

and i had to change the settings.

ezik

Offline

#3 2011-04-10 20:21:44

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [Probably solved] Setting clock fails during boot (wrong time)

Did you check if your system's time skew is correctly adjusted?


To know or not to know ...
... the questions remain forever.

Offline

#4 2011-04-11 07:09:47

RobertMe
Member
From: The Netherlands
Registered: 2010-07-04
Posts: 45

Re: [Probably solved] Setting clock fails during boot (wrong time)

bernarcher wrote:

Did you check if your system's time skew is correctly adjusted?

Will check that this evening when I'm at that PC. The man page described a /etc/adjtime file, but reading the wiki page it seems the file has moved to /var/lib/hwclock/adjtime, so I was searching for the wrong/absent file.

Offline

#5 2011-04-11 17:21:13

RobertMe
Member
From: The Netherlands
Registered: 2010-07-04
Posts: 45

Re: [Probably solved] Setting clock fails during boot (wrong time)

This is the content of the adjtime file, and I don't think it looks that good:

-15679614.502536 1302460653 0.000000
1302460653
LOCAL

To me it seems it tries to set the clock back for 181 days due to the time skew of the hardware clock. I removed the file, ran hwclock --adjtime and the hardware clock seems not to have changed (checked with hwclock --show) , which is good.

I will keep checking if the clock is still running fine, and when it doesn't I will report back here.

Offline

#6 2011-04-11 19:54:09

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [Probably solved] Setting clock fails during boot (wrong time)

The problem is that you are on localtime (LOCAL in your /var/lib/hwclock/adjtime) -- change HARDWARECLOCK to UTC in rc.conf. Then, BIOS clock will always show UTC, and the system will add or subtract necessary number of hours to fit your timezone.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

Board footer

Powered by FluxBB