Björn Bredohl <[EMAIL PROTECTED]> posted [EMAIL PROTECTED], excerpted below, on Sat, 09 Jun 2007 09:52:09 +0200:
> It works like this: hwclock keeps a file, /etc/adjtime, that keeps some > historical information. This is called the adjtime file. In addition, the Gentoo clock initscript is setup such that you can both control where adjtime is kept, and choose not to use it at all, recommended if you are using ntpd or the like. The comment from the default /etc/conf.d/clock config, as of baselayout-1.13.0_alpha12 (~amd64 AFAIK, tho I had unmasked and was testing it before it went ~arch), and some example settings: # Newer FHS specs say this file should live in /var/lib rather than # /etc. If you care about such things, feel free to change this value. # Note that a blank value means that you do not wish to even use the # adjtime facility. This is the default behavior as adjtime can be # very fragile. If the clock is updated without updating the adjtime # file (which is common when using services such as ntp), then the # clock can be screwed up when it gets updated at next boot. #CLOCK_ADJTIME="/var/lib/adjtime" #CLOCK_ADJTIME="/etc/adjtime" #CLOCK_ADJTIME="" That's straight out of my conf.d/clock config, so as you can see, I'm using the default, which is as noted, NOT to use /etc/adjtime. FWIW, that's a fairly recent change here. I was using it for quite awhile without serious issue I could see from either ntpd or the clock initscript, but having read about the possible issues, I decided to be safe rather than sorry, and disable it. I then erased /etc/adjtime, and it hasn't been recreated, so the clock initscript indeed seems to be honoring my config. Typically after an overnight suspend to disk (aka hibernate, here accomplished with a script that pauses the ntpd, ntp-client and clock scripts, syncing the hardware clock to the system clock at clock service pause as I've got that configured as well, then restarts them after the restart), when I restart and the services restart, ntp-client makes a correction of between 0.2 and 0.6 seconds, which the clock service was apparently originally taking into account with adjtime. Now that I'm not using adjtime, the clock service isn't adjusting for that, but as I said, ntp-client catches it in the time-sync before ntpd starts (and the updated system clock is in turn copied to hwclock at hibernate or system shutdown, completing the update cycle), and that should be much more robust. Note that this was AFAIK one of the features that changed a bit with baselayout-1.13, so those on stable, still using baselayout-1.12.x, will probably have a slightly different clock config, with a different way to disable /etc/adjtime. If worse comes to worse, it should be possible to add a rm /etc/adjtime call to /etc/conf.d/local.start or whatever, so the file is removed automatically shortly after creation and thus can't be used by the clock initscript. -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman -- [EMAIL PROTECTED] mailing list
