Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: Time Drift
Date: Sat, 09 Jun 2007 12:32:17
Message-Id: pan.2007.06.09.12.27.23@cox.net
In Reply to: Re: [gentoo-amd64] Time Drift by "Björn Bredohl"
1 Björn Bredohl <bjoern@×××××××.de> posted 466A5C29.4020701@×××××××.de,
2 excerpted below, on Sat, 09 Jun 2007 09:52:09 +0200:
3
4 > It works like this: hwclock keeps a file, /etc/adjtime, that keeps some
5 > historical information. This is called the adjtime file.
6
7 In addition, the Gentoo clock initscript is setup such that you can both
8 control where adjtime is kept, and choose not to use it at all,
9 recommended if you are using ntpd or the like. The comment from the
10 default /etc/conf.d/clock config, as of baselayout-1.13.0_alpha12 (~amd64
11 AFAIK, tho I had unmasked and was testing it before it went ~arch), and
12 some example settings:
13
14 # Newer FHS specs say this file should live in /var/lib rather than
15 # /etc. If you care about such things, feel free to change this value.
16 # Note that a blank value means that you do not wish to even use the
17 # adjtime facility. This is the default behavior as adjtime can be
18 # very fragile. If the clock is updated without updating the adjtime
19 # file (which is common when using services such as ntp), then the
20 # clock can be screwed up when it gets updated at next boot.
21
22 #CLOCK_ADJTIME="/var/lib/adjtime"
23 #CLOCK_ADJTIME="/etc/adjtime"
24 #CLOCK_ADJTIME=""
25
26 That's straight out of my conf.d/clock config, so as you can see, I'm
27 using the default, which is as noted, NOT to use /etc/adjtime. FWIW,
28 that's a fairly recent change here. I was using it for quite awhile
29 without serious issue I could see from either ntpd or the clock
30 initscript, but having read about the possible issues, I decided to be
31 safe rather than sorry, and disable it.
32
33 I then erased /etc/adjtime, and it hasn't been recreated, so the clock
34 initscript indeed seems to be honoring my config.
35
36 Typically after an overnight suspend to disk (aka hibernate, here
37 accomplished with a script that pauses the ntpd, ntp-client and clock
38 scripts, syncing the hardware clock to the system clock at clock service
39 pause as I've got that configured as well, then restarts them after the
40 restart), when I restart and the services restart, ntp-client makes a
41 correction of between 0.2 and 0.6 seconds, which the clock service was
42 apparently originally taking into account with adjtime. Now that I'm not
43 using adjtime, the clock service isn't adjusting for that, but as I said,
44 ntp-client catches it in the time-sync before ntpd starts (and the
45 updated system clock is in turn copied to hwclock at hibernate or system
46 shutdown, completing the update cycle), and that should be much more
47 robust.
48
49 Note that this was AFAIK one of the features that changed a bit with
50 baselayout-1.13, so those on stable, still using baselayout-1.12.x, will
51 probably have a slightly different clock config, with a different way to
52 disable /etc/adjtime. If worse comes to worse, it should be possible to
53 add a rm /etc/adjtime call to /etc/conf.d/local.start or whatever, so the
54 file is removed automatically shortly after creation and thus can't be
55 used by the clock initscript.
56
57 --
58 Duncan - List replies preferred. No HTML msgs.
59 "Every nonfree program has a lord, a master --
60 and if you use the program, he is your master." Richard Stallman
61
62 --
63 gentoo-amd64@g.o mailing list