vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| This is really flaming annoying. My laptop (An IBM Thinkpad 600E, once upon a time the cadillac of Linux in a Lap) does everything right, usually. Everything on it just works under gentoo. Recently, however, it's been losing track of time and not restoring it properly. The hardware clock is fine, the memory is fine when is standby (i.e. the RAM is kept fresh by a power trickle rather than being written out to disk), so it's not a power delivery problem. Why would this start acting up NOW? Elf |
| |||
| Geoff King <gking@evildomain.dyndns.org> writes: > On Thu, 03 Feb 2005 09:16:17 -0800, Elf M. Sternberg wrote: > > > Why would this start acting up NOW? > > Are you using software suspend? No, hardware. And someone else suggested that the mobo battery might be dying. Possible, but the hwclock doesn't lose track of time; it's just that the hardware update doesn't grab current time when coming out of standby. Elf |
| |||
| Elf M. Sternberg enlightened us with: > Recently, however, it's been losing track of time and not restoring > it properly. Remove /etc/adjtime, and then use something like ntp-client or rdate to reset your clock. Then remove /etc/adjtime again. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? |
| |||
| On Fri, 04 Feb 2005 08:47:30 +0100, Sybren Stuvel wrote: > Elf M. Sternberg enlightened us with: >> Recently, however, it's been losing track of time and not restoring it >> properly. > > Remove /etc/adjtime, and then use something like ntp-client or rdate to > reset your clock. Then remove /etc/adjtime again. > > Sybren Learn something everyday! From the man hwclock page: Automatic Hardware Clock Synchronization By the Kernel You should be aware of another way that the Hardware Clock is kept syn- chronized in some systems. The Linux kernel has a mode wherein it copies the System Time to the Hardware Clock every 11 minutes. This is a good mode to use when you are using something sophisticated like ntp to keep your System Time synchronized. (ntp is a way to keep your Sys- tem Time synchronized either to a time server somewhere on the network or to a radio clock hooked up to your system. See RFC 1305). This mode (we'll call it "11 minute mode") is off until something turns it on. The ntp daemon xntpd is one thing that turns it on. You can turn it off by running anything, including hwclock --hctosys, that sets the System Time the old fashioned way. To see if it is on or off, use the command adjtimex --print and look at the value of "status". If the "64" bit of this number (expressed in binary) equal to 0, 11 minute mode is on. Otherwise, it is off. If your system runs with 11 minute mode on, don't use hwclock --adjust or hwclock --hctosys. You'll just make a mess. It is acceptable to use a hwclock --hctosys at startup time to get a reasonable System Time until your system is able to set the System Time from the external source and start 11 minute mode. ----- I use ntpd. It looks like I need to edit out the line with --adjust in the /etc/init.d/clock file: ebegin "Setting system clock to hardware clock ${TBLURB}" errstr="$(/sbin/hwclock --adjust ${myopts} 2>&1 >/dev/null)" errstr="${errstr}$(/sbin/hwclock --hctosys ${myopts} 2>&1 >/dev/null)" Because according to the documentation, it looks like I'd be screwing myself up all the time with it in, right? root@mars /etc/init.d # adjtimex --print mode: 0 offset: 0 frequency: 0 maxerror: 16384000 esterror: 16384000 status: 64 time_constant: 2 precision: 1 tolerance: 33554432 tick: 10000 raw time: 1107527514s 60842us = 1107527514.060842 return value = 5 For Linux 2.0 kernels, the value is a sum of these: 1 PLL updates enabled 2 PPS freq discipline enabled 4 PPS time discipline enabled 8 frequency-lock mode enabled 16 inserting leap second 32 deleting leap second 64 clock unsynchronized But wait a moment. I have ntpd but the status shows the clock is unsynchronized! ntpd is running and I can see its status messages in the log. Any ntpd experts out there? |
| |||
| On Fri, 04 Feb 2005 09:41:45 -0500, Peter wrote: snip... > > root@mars /etc/init.d # adjtimex --print > mode: 0 > offset: 0 > frequency: 0 > maxerror: 16384000 > esterror: 16384000 > status: 64 > time_constant: 2 > precision: 1 > tolerance: 33554432 > tick: 10000 > raw time: 1107527514s 60842us = 1107527514.060842 > return value = 5 > > For Linux 2.0 kernels, the value is a sum of these: > 1 PLL updates enabled > 2 PPS freq discipline enabled > 4 PPS time discipline enabled > 8 frequency-lock mode enabled > 16 inserting leap second > 32 deleting leap second > 64 clock unsynchronized > > But wait a moment. I have ntpd but the status shows the clock is > unsynchronized! ntpd is running and I can see its status messages in the > log. > > Any ntpd experts out there? A quick comparison vs date, hwclock --show, and a real time snapshot from www.time.gov shows date to be right on (that's the system clock), and hwclock shows a slight 2 second drift. I suppose that's correct, but not sure if the --adjust setting is even needed at startup. root@mars /home/peter # hwclock --show && date Fri Feb 4 10:46:49 2005 -0.463658 seconds Fri Feb 4 10:46:47 EST 2005 The bottom time is right. |