Gentoo Archives: gentoo-amd64

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] [SOLVED] Recent clock problems
Date: Sat, 11 Feb 2006 22:17:19
Message-Id: 5bdc1c8b0602111414k3715185i4eb7eb5bd6f75fe6@mail.gmail.com
In Reply to: [gentoo-amd64] Re: Recent clock problems by Duncan <1i5t5.duncan@cox.net>
1 On 2/11/06, Duncan <1i5t5.duncan@×××.net> wrote:
2 > Mark Knecht posted
3 > <5bdc1c8b0602110941y446deb24qc519fcb40298136a@××××××××××.com>, excerpted
4 > below, on Sat, 11 Feb 2006 09:41:20 -0800:
5 >
6 > > Hello,
7 > > Just in the last week or so my AMD64 machine has started to exhibit
8 > > problems with the clock. Maybe it's a hardware problem, or possibly
9 > > it's some new ntpd issue after updates. At boot time it seems to be
10 > > coming up with semi-random times. This is causing me to ask a few
11 > > questions and try to learn a bit more about how this actually works
12 > > under Linux. Thanks in advance.
13 >
14 > Those can be quite frustrating. I'm not a master, but somehow, I've
15 > managed to bluster my way thru a couple frustrating episodes.
16 >
17 > > QUESTION 1: UTC vs. local
18 > >
19 > > In /etc/conf.d/clock I can choose UTC vs. local. Does this refer to
20 > > the time I set in the hardware clock or something else? Nominally it's
21 > > easier sitting here in California to set the hardware clock to
22 > > California time. Is there any problem with doing this? If I understand
23 > > the comments I should be using 'local' but the default seemed to be
24 > > UTC.
25 >
26 > UTC is effectively what used to be called GMT, Universal Time Coordinated
27 > (I believe French, so looks backward to us English folks), Greenwich Mean
28 > Time, the time standardized to London, UTC indicating as updated with
29 > official leap-seconds, according to kdict (just looked it up to be sure to
30 > get it right).
31 >
32 > The continental US is of course 5-8 hours behind UTC, with an adjustment
33 > for DST in the summer, naturally (that I thankfully don't have to worry
34 > about here in AZ).
35 >
36 > Traditionally, Unix has kept system time in UTC, while MSWormOS kept it in
37 > local time, so if you are booting between the two, it can /really/ screw
38 > things up. Modern Linux has a toggle, but if the toggle gets out of sync
39 > for some reason, you'll see it jumping back and forth by those several
40 > hours, as you boot and reset it and reboot. To get it synced back up can
41 > be more difficult than you'd expect, because if you don't do all the steps
42 > in the right order, it either doesn't take, or it takes, but just confirms
43 > the offset once again.
44
45 I think the only thing I'm not clear about here is what is actually in
46 the hardware clock? If I keep time in UTC then when date tells me 4PM
47 is the hardware clock holding midnight? (I'm in CA - offset is 8
48 hours.)
49
50 Can I check this somehow, like going into BIOS?
51
52 Right now I've set the clock back to UTC and rebooted. This is what I
53 see now. It has the 8 hour offset:
54
55 lightning ~ # hwclock
56 Sat Feb 11 14:04:13 2006 -0.156743 seconds
57 lightning ~ # hwclock --debug
58 hwclock from util-linux-2.12r
59 Using /dev/rtc interface to clock.
60 Last drift adjustment done at 1139695116 seconds after 1969
61 Last calibration done at 1139695116 seconds after 1969
62 Hardware clock is on UTC time
63 Assuming hardware clock is kept in UTC time.
64 Waiting for clock tick...
65 /dev/rtc does not have interrupt functions. Waiting in loop for time
66 from /dev/rtc to change
67 ...got clock tick
68 Time read from Hardware Clock: 2006/02/11 22:04:21
69 Hw clock time : 2006/02/11 22:04:21 = 1139695461 seconds since 1969
70 Sat Feb 11 14:04:21 2006 -0.165847 seconds
71 lightning ~ #
72
73 <SNIP>
74 >
75 > OK, so what is used to do a time step, if ntpd normally does time skews?
76 >
77 > That's ntp-client. If you have ntp running on your system, you'll
78 > probably want both ntpd and ntp-client in your default runlevel.
79 > ntp-client runs before ntpd, and steps the clock to /approximately/ the
80 > correct time (within 100ms or so). It's a single-shot run at boot, after
81 > which ntpd starts, does it's connections to see how far it has to adjust,
82 > and gets to work doing the skew.
83
84 OK, for now anyway this seems to be the solution. I have never run
85 ntp-client. For whatever reason I've never required it. It seems that
86 some set of recent updates - ntp or whatever - have now started
87 requirign that I run it. With this turned on my AMD64 machine is
88 within a second (the speed at twhich I can hit enter in two
89 terminals...) of my wife's Gentoo 32-bit machine.
90
91 Thanks Duncan! As usual your answers are very through and well
92 written. It's like a very straight forward class that seems to answer
93 most all of my questions and leaves me with a lot of certainty that if
94 I just follow along carefully I'll learn something.
95
96 Cheers,
97 Mark
98
99 --
100 gentoo-amd64@g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] [SOLVED] Recent clock problems Barry.SCHWARTZ@×××××××××××××.org
Re: [gentoo-amd64] [SOLVED] Recent clock problems "Hemmann