View previous topic :: View next topic |
Author |
Message |
cazza n00b
Joined: 15 Feb 2005 Posts: 10
|
Posted: Thu Apr 21, 2005 3:41 pm Post subject: Time, date and zoneinfo |
|
|
I have a problem with the clock of my gentoo machine, and after some googling I only got more confused. The issue is this: When I reboot, my clock is ok, but occasionally when my gentoo hangs and I have to press reset, the clock is wrong by one hour (one hour late).
I have set /etc/localtime to /usr/share/zoneinfo/Europe/Brussels (which differs with UTC or Greenwich time by +1 hour). The kernel is set to use the hardware clock as UTC, and in /etc/rc.local I have the line CLOCK="local". I use a ntp server to synchronize with (ntpd shuts down however when the time-difference between the system clock and the ntp-server exceeds one hour)
But now I get these results:
Code: | $ hwclock --utc
Thu Apr 21 18:28:53 2005 -0.945329 seconds
$ hwclock --localtime
Thu Apr 21 16:28:58 2005 -0.570309 seconds
$ date
Thu Apr 21 17:29:02 CEST 2005
$ date -u
Thu Apr 21 15:29:04 UTC 2005
|
(it is really 17.29 when typing this). All this does not make very much sense to me. The date command indeed gives the correct time, but that's it. The hardware clock is wrong, both as utc and localtime (why is the difference 2 hours by the way), as is the utc-time returned by date (also two hours off, but in the other direction...).
If anyone can help me on this, or give some explanation what these different things mean, I would be very gratefull.
thank you
PS: this may not look like a big issue, but we have 80 identical gentoo installations running here which all have this problem, and figuring out once and for all what goes wrong with this clock-issue is less work than manually correcting clocks every now and then. |
|
Back to top |
|
|
Petyr Guru
Joined: 08 Jan 2003 Posts: 471 Location: San Diego, CA, USA
|
Posted: Thu Apr 21, 2005 4:31 pm Post subject: |
|
|
You probalby want to check out /etc/conf.d/clock and make sure that it says CLOCK="UTC"
I think somehow it's try to slam the clock in a few different directions and ultimately it things "Oh the clock is UTC, and I meant for it to be in local so *bampf* +1 hour!"
Might also want to set your rc.local to be CLOCK="UTC" as well. Pretty sure that you want all these files to agree on what is set to what. Could be wrong, I don't have an rc.local on my machine.
hth,
Petyr |
|
Back to top |
|
|
cazza n00b
Joined: 15 Feb 2005 Posts: 10
|
Posted: Fri Apr 29, 2005 8:22 am Post subject: |
|
|
Thanks for your answer. At first however I did not find this clock configfile you are talking about, untill I realised this requires the new baselayout. Since I preferrably use the stable versions of things (research environment here), this solution is not possible for me.
I did however solve the problem another way. First of all, the two hour timedifference was due to the daylight savings time that is in effect here, but not in UTC. Messing with the UTC or local settings still did not solve the problem, but using ntp-client did however. This program gets called before ntpd starts, and syncs the systemclock with an ntp-server instead the hwclock. The config file is in /etc/conf.d/ntp-client (fill in an accessible server there), and it should be added to the default runlevel.
At least now the clock is always correct after a reboot
Thanks |
|
Back to top |
|
|
DRSON n00b
Joined: 09 May 2005 Posts: 15 Location: Prague, Czech Republic
|
Posted: Thu May 12, 2005 9:28 pm Post subject: |
|
|
In old baselayout CLOCK="local" is in /etc/rc.conf |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|