* [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
@ 2006-01-27 15:28 Abhay Kedia
2006-01-27 16:10 ` Michael A. Smith
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Abhay Kedia @ 2006-01-27 15:28 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]
Hello Everyone,
I am facing a very annoying problem with my system clock. Here is what is
happening.
I manually set correct time using sites like worldtimezone.com. Then, I
shutdown the system and boot after a few hours. What I see is that Gentoo
sets the system time to the same one at which I halted it. For example if I
shutdown 4 hours ago at 14:00 hrs and boot at 18:00 hrs, it will still set
the time to 14:00 hrs instead of the correct time.
The CMOS battery is fine. I can say this because if I enter the BIOS (after 4
hours reboot) it shows the correct time. I start a Live CD, it shows the
correct time as well, but when I start Gentoo it sets the wrong system time
or as mentioned in example: "4 hours back". It writes the time it was
shutdown on, over the BIOS Clock instead of reading from it. How can I solve
it? How can I force Gentoo to read from the BIOS Clock at the time of boot,
instead of writing it. If it helps, here is my /etc/conf.d/clock.
---------------------------------
# /etc/conf.d/clock
CLOCK="local"
CLOCK_OPTS=""
CLOCK_SYSTOHC="no" (have tried both yes and no)
SRM="no"
ARC="no"
---------------------------------
I am not using ntp or any other such softwares because I don't have an all
time working Internet Connection.
I would be greatful if someone could help me solve this weird problem.
--
Regards,
Abhay
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-27 15:28 [gentoo-user] Wrong time on reboot. Not a CMOS battery problem Abhay Kedia
@ 2006-01-27 16:10 ` Michael A. Smith
2006-01-27 16:49 ` Abhay Kedia
` (2 more replies)
2006-01-27 17:59 ` Uwe Thiem
2006-01-27 21:25 ` Benno Schulenberg
2 siblings, 3 replies; 15+ messages in thread
From: Michael A. Smith @ 2006-01-27 16:10 UTC (permalink / raw
To: gentoo-user
Abhay Kedia wrote:
> I manually set correct time using sites like worldtimezone.com. Then, I
> shutdown the system and boot after a few hours. What I see is that Gentoo
> sets the system time to the same one at which I halted it. For example if I
> shutdown 4 hours ago at 14:00 hrs and boot at 18:00 hrs, it will still set
> the time to 14:00 hrs instead of the correct time.
<snip>
> here is my /etc/conf.d/clock.
>
> ---------------------------------
> # /etc/conf.d/clock
> CLOCK="local"
> CLOCK_OPTS=""
> CLOCK_SYSTOHC="no" (have tried both yes and no)
> SRM="no"
> ARC="no"
> ---------------------------------
>
> I am not using ntp or any other such softwares
Hmm, according to the initscript, /etc/init.d/clock isn't supposed to
care about the CLOCK_SYSTOHC option until stop(). But it is supposed
to set the *system* clock to the hardware clock, so that if the
hardware clock is right at boot time, so should be the system clock.
I'm not sure, but I suspect that somehow the clock device that
/sbin/hwclock is supposed to be talking to is actually static for
some reason, and doesn't match your BIOS clock.
That deserves looking into: I'd start with the kernel config. Maybe
something about /dev/rtc?
But the quick fix is probably rc-update del clock. I don't know if
that's a Bad Thing To Do (TM), but nobody screamed when I asked about
it in #gentoo.
Have a great day,
Mike
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-27 16:10 ` Michael A. Smith
@ 2006-01-27 16:49 ` Abhay Kedia
2006-01-27 18:03 ` Uwe Thiem
2006-01-28 4:13 ` Abhay Kedia
2 siblings, 0 replies; 15+ messages in thread
From: Abhay Kedia @ 2006-01-27 16:49 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 873 bytes --]
On Friday 27 January 2006 21:40, Michael A. Smith wrote:
>
> That deserves looking into: I'd start with the kernel config. Maybe
> something about /dev/rtc?
>
Here are the outputs
-------------------------------------------
genbox abhay # ls -l /dev/rtc
ls: /dev/rtc: No such file or directory
genbox abhay # grep RTC /usr/src/linux/.config
# CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
CONFIG_HPET_RTC_IRQ=y
# CONFIG_SENSORS_RTC8564 is not set
# CONFIG_RTC_X1205_I2C is not set
-------------------------------------------
I tried setting CONFIG_RTC to "y" but that didn't help either.
>
>But the quick fix is probably rc-update del clock.
>
I am apprehensive towards doing that. It is a boot time service. How smart
would it be to remove it from there. If I try that, would I break my system
instantaneously?
--
Regards,
Abhay
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-27 16:10 ` Michael A. Smith
2006-01-27 16:49 ` Abhay Kedia
@ 2006-01-27 18:03 ` Uwe Thiem
2006-01-27 18:41 ` Michael A. Smith
2006-01-28 4:13 ` Abhay Kedia
2 siblings, 1 reply; 15+ messages in thread
From: Uwe Thiem @ 2006-01-27 18:03 UTC (permalink / raw
To: gentoo-user
On 27 January 2006 18:10, Michael A. Smith wrote:
> Abhay Kedia wrote:
> > I manually set correct time using sites like worldtimezone.com. Then, I
> > shutdown the system and boot after a few hours. What I see is that Gentoo
> > sets the system time to the same one at which I halted it. For example if
> > I shutdown 4 hours ago at 14:00 hrs and boot at 18:00 hrs, it will still
> > set the time to 14:00 hrs instead of the correct time.
>
> <snip>
>
> > here is my /etc/conf.d/clock.
> >
> > ---------------------------------
> > # /etc/conf.d/clock
> > CLOCK="local"
> > CLOCK_OPTS=""
> > CLOCK_SYSTOHC="no" (have tried both yes and no)
> > SRM="no"
> > ARC="no"
> > ---------------------------------
> >
> > I am not using ntp or any other such softwares
>
> Hmm, according to the initscript, /etc/init.d/clock isn't supposed to
> care about the CLOCK_SYSTOHC option until stop(). But it is supposed
> to set the *system* clock to the hardware clock, so that if the
> hardware clock is right at boot time, so should be the system clock.
>
> I'm not sure, but I suspect that somehow the clock device that
> /sbin/hwclock is supposed to be talking to is actually static for
> some reason, and doesn't match your BIOS clock.
The device hwclock connects to *is* the BIOS clock.
Uwe
--
Unix is sexy:
who | grep -i blonde | date
cd ~; unzip; touch; strip; finger
mount; gasp; yes; uptime; umount
sleep
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-27 18:03 ` Uwe Thiem
@ 2006-01-27 18:41 ` Michael A. Smith
0 siblings, 0 replies; 15+ messages in thread
From: Michael A. Smith @ 2006-01-27 18:41 UTC (permalink / raw
To: gentoo-user
Uwe Thiem wrote:
> The device hwclock connects to *is* the BIOS clock.
>
> Uwe
Let me rephrase. A physical device has to have a software
representation for software to "connect" to it. I'm trying to suggest
that something is wrong with that interface. Clearly Abhay's BIOS
clock doesn't jive with what the system *thinks* the hardware clock
says. /etc/init.d/clock also doesn't break or give an error when he
runs it (I guess). So that leaves that there is some interface giving
a syntactically-correct WRONG ANSWER as to the time, at boot time.
- Mike
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-27 16:10 ` Michael A. Smith
2006-01-27 16:49 ` Abhay Kedia
2006-01-27 18:03 ` Uwe Thiem
@ 2006-01-28 4:13 ` Abhay Kedia
2 siblings, 0 replies; 15+ messages in thread
From: Abhay Kedia @ 2006-01-28 4:13 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 450 bytes --]
On Friday 27 January 2006 21:40, Michael A. Smith wrote:
>
> But the quick fix is probably rc-update del clock. I don't know if
> that's a Bad Thing To Do (TM), but nobody screamed when I asked about
> it in #gentoo.
>
Though the problem is solved now but it is still worth mentioning that
removing clock from boot is not possible until i remove bootmisc, syslog-ng
and vixie-cron as well.
Thanks for you time :-)
--
Regards,
Abhay
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-27 15:28 [gentoo-user] Wrong time on reboot. Not a CMOS battery problem Abhay Kedia
2006-01-27 16:10 ` Michael A. Smith
@ 2006-01-27 17:59 ` Uwe Thiem
2006-01-28 4:14 ` Abhay Kedia
2006-01-27 21:25 ` Benno Schulenberg
2 siblings, 1 reply; 15+ messages in thread
From: Uwe Thiem @ 2006-01-27 17:59 UTC (permalink / raw
To: gentoo-user
On 27 January 2006 17:28, Abhay Kedia wrote:
> Hello Everyone,
>
> I am facing a very annoying problem with my system clock. Here is what is
> happening.
>
> I manually set correct time using sites like worldtimezone.com. Then, I
> shutdown the system and boot after a few hours. What I see is that Gentoo
> sets the system time to the same one at which I halted it. For example if I
> shutdown 4 hours ago at 14:00 hrs and boot at 18:00 hrs, it will still set
> the time to 14:00 hrs instead of the correct time.
>
> The CMOS battery is fine. I can say this because if I enter the BIOS (after
> 4 hours reboot) it shows the correct time. I start a Live CD, it shows the
> correct time as well, but when I start Gentoo it sets the wrong system time
> or as mentioned in example: "4 hours back". It writes the time it was
> shutdown on, over the BIOS Clock instead of reading from it. How can I
> solve it? How can I force Gentoo to read from the BIOS Clock at the time of
> boot, instead of writing it. If it helps, here is my /etc/conf.d/clock.
>
> ---------------------------------
> # /etc/conf.d/clock
> CLOCK="local"
> CLOCK_OPTS=""
> CLOCK_SYSTOHC="no" (have tried both yes and no)
> SRM="no"
> ARC="no"
> ---------------------------------
Your system has two different clocks, the system clock which is software and
the hardware clock which is, well, hardware. After adjusting your system
clock with "date" try this: "hwclock -w. Does that solve the problem?
If so, you are set.
If not so, what is your timezone (in real life)? And what is the timezone in
your gentoo setup set to? That is, what is /etc/localtime pointing to? Do
they match?
Is TZ set in your environment? If so, unset it and let /etc/localtime do the
job.
>
> I am not using ntp or any other such softwares because I don't have an all
> time working Internet Connection.
Once your clocks are sorted out, you can still use ntpdate to synchronise your
system clock with a time server whenever you go online.
Uwe
--
Unix is sexy:
who | grep -i blonde | date
cd ~; unzip; touch; strip; finger
mount; gasp; yes; uptime; umount
sleep
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-27 15:28 [gentoo-user] Wrong time on reboot. Not a CMOS battery problem Abhay Kedia
2006-01-27 16:10 ` Michael A. Smith
2006-01-27 17:59 ` Uwe Thiem
@ 2006-01-27 21:25 ` Benno Schulenberg
2006-01-28 4:08 ` Abhay Kedia
2006-01-28 4:15 ` Abhay Kedia
2 siblings, 2 replies; 15+ messages in thread
From: Benno Schulenberg @ 2006-01-27 21:25 UTC (permalink / raw
To: gentoo-user
Abhay Kedia wrote:
> I manually set correct time using sites like worldtimezone.com.
How? What commands do you give?
> Then, I shutdown the system and boot after a few hours. What I
> see is that Gentoo sets the system time to the same one at which
> I halted it. For example if I shutdown 4 hours ago at 14:00 hrs
> and boot at 18:00 hrs, it will still set the time to 14:00 hrs
> instead of the correct time.
Try running 'hwclock --show --debug', and run it again a bunch of
seconds later. Is the hardware clock ticking?
Here's a sample output:
# hwclock --show --debug
hwclock from util-linux-2.12r
hwclock: Open of /dev/rtc failed, errno=2: No such file or
directory.
Using direct I/O instructions to ISA clock.
Last drift adjustment done at 1138395601 seconds after 1969
Last calibration done at 1138395601 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2006/01/27 21:04:32
Hw clock time : 2006/01/27 21:04:32 = 1138395872 seconds since 1969
Fri Jan 27 22:04:32 2006 -0.579761 seconds
If it is ticking , then set the hardware clock to the correct time
with 'hwclock --set --date=<thistime>', then throw away the
/etc/adjtime file. Throw it away, as it might be the adjusting
feature that thinks your clock is drifting a full hour per hour
(that is: ticks away two hours in one).
> # /etc/conf.d/clock
> CLOCK="local"
Do you need the "local" time thing? If Linux is the only OS on your
box it's easier to use UTC.
Your time zone is set correctly? Where is /etc/localtime linking
to?
Benno
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-27 21:25 ` Benno Schulenberg
@ 2006-01-28 4:08 ` Abhay Kedia
2006-01-28 15:08 ` Benno Schulenberg
2006-01-28 4:15 ` Abhay Kedia
1 sibling, 1 reply; 15+ messages in thread
From: Abhay Kedia @ 2006-01-28 4:08 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 835 bytes --]
On Saturday 28 January 2006 02:55, Benno Schulenberg wrote:
>
> If it is ticking , then set the hardware clock to the correct time
> with 'hwclock --set --date=<thistime>', then throw away the
> /etc/adjtime file. Throw it away, as it might be the adjusting
> feature that thinks your clock is drifting a full hour per hour
> (that is: ticks away two hours in one).
>
That was it!!! That was the file causing all the pain. I moved it away and now
there are no problems. Any ideas why it was doing it. The file is obviously
there for some reason but it was not functioning properly. It must be
something that I messed up. How can I find out?
>
> Do you need the "local" time thing? If Linux is the only OS on your
> box it's easier to use UTC.
>
Yes I boot multiple OS so I need "local"
--
Regards,
Abhay
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-28 4:08 ` Abhay Kedia
@ 2006-01-28 15:08 ` Benno Schulenberg
2006-01-28 16:23 ` Abhay Kedia
0 siblings, 1 reply; 15+ messages in thread
From: Benno Schulenberg @ 2006-01-28 15:08 UTC (permalink / raw
To: gentoo-user
Abhay Kedia wrote:
> On Saturday 28 January 2006 02:55, Benno Schulenberg wrote:
> > the /etc/adjtime file. Throw it away, as it might be the
> > adjusting feature that thinks your clock is drifting a full
> > hour per hour (that is: ticks away two hours in one).
>
> That was it!!! That was the file causing all the pain. I moved it
> away and now there are no problems. Any ideas why it was doing
> it.
A possibility is that you've set the hwclock twice, first with a
wrong time, then say ten minutes later you realize your watch is
five minutes fast, and you set the clock again, with the correct
time. Now the adjust feature thinks your CMOS clock is ticking
away ten minutes in just five minutes, and every time you boot your
computer it will adjust the CMOS clock for this drift and then read
it to set the system time.
This drift correction feature is useful, but one should be aware of
it when setting the hardware clock manually: remove the /etc/adjtime
file after 'hwclock --set' has been used with a wrong time.
> The file is obviously there for some reason
See man hwclock, the section on "The Adjust Function".
Benno
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-28 15:08 ` Benno Schulenberg
@ 2006-01-28 16:23 ` Abhay Kedia
2006-01-29 13:56 ` Benno Schulenberg
0 siblings, 1 reply; 15+ messages in thread
From: Abhay Kedia @ 2006-01-28 16:23 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 444 bytes --]
On Saturday 28 January 2006 20:38, Benno Schulenberg wrote:
>
> See man hwclock, the section on "The Adjust Function".
>
Thanks for the explanation and the tip. It certainly makes sense now :-)
Also, should I enable RTC in my kernel? I disabled it recently when I was
trying to get to the root of this problem. I am also using HPET in my kernel.
Can I use both these features? Do they clash with each other?
--
Regards,
Abhay
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-28 16:23 ` Abhay Kedia
@ 2006-01-29 13:56 ` Benno Schulenberg
0 siblings, 0 replies; 15+ messages in thread
From: Benno Schulenberg @ 2006-01-29 13:56 UTC (permalink / raw
To: gentoo-user
Abhay Kedia wrote:
> Also, should I enable RTC in my kernel?
As seen from the debug output, hwclock works fine without it. But
maybe some other programs have some use for it, I don't know, here
it is off.
> I am also using HPET in my kernel. Can I use both these features?
> Do they clash with each other?
If they would clash, then it shouldn't be possible to select them
both. But do you use HPET? If not, then I would disable it.
Benno
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Wrong time on reboot. Not a CMOS battery problem.
2006-01-27 21:25 ` Benno Schulenberg
2006-01-28 4:08 ` Abhay Kedia
@ 2006-01-28 4:15 ` Abhay Kedia
1 sibling, 0 replies; 15+ messages in thread
From: Abhay Kedia @ 2006-01-28 4:15 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 400 bytes --]
>
> with 'hwclock --set --date=<thistime>', then throw away the
> /etc/adjtime file. Throw it away, as it might be the adjusting
> feature that thinks your clock is drifting a full hour per hour
> (that is: ticks away two hours in one).
>
Stupid me!!! Totally forgot to do the most important thing i.e. to thank you
for the help. Thanks a lot for that great tip :-)
--
Regards,
Abhay
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2006-01-29 14:04 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-27 15:28 [gentoo-user] Wrong time on reboot. Not a CMOS battery problem Abhay Kedia
2006-01-27 16:10 ` Michael A. Smith
2006-01-27 16:49 ` Abhay Kedia
2006-01-27 18:03 ` Uwe Thiem
2006-01-27 18:41 ` Michael A. Smith
2006-01-28 4:13 ` Abhay Kedia
2006-01-27 17:59 ` Uwe Thiem
2006-01-28 4:14 ` Abhay Kedia
2006-01-28 7:14 ` Uwe Thiem
2006-01-27 21:25 ` Benno Schulenberg
2006-01-28 4:08 ` Abhay Kedia
2006-01-28 15:08 ` Benno Schulenberg
2006-01-28 16:23 ` Abhay Kedia
2006-01-29 13:56 ` Benno Schulenberg
2006-01-28 4:15 ` Abhay Kedia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox