Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
system time drift - solved.
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
antifa
n00b
n00b


Joined: 17 May 2002
Posts: 31

PostPosted: Wed Jul 17, 2002 3:28 am    Post subject: system time drift - solved. Reply with quote

My system time drifts about 12 hours off (roughly) inside an hour after I log out. I replaced the CMOS battery, verified /etc/localtime, verified rc.conf was set to use local for time instead of UTC, recompiled the kernel to make sure RTC support was enabled. recompiled rdate and ntpd, and verified the /etc/init.d/clock script.

The drift only occurs when I log out. Once I do, the drift gets bad enough that it kills ntpd (because ntp can onyl adjust the time in steps, not jumps). This issue doesn't occur in win98 (dual boot box). I also tried setting a cron job to 'rdate -s ntpserv' every 15 minutes, but it would only update the system time if i was logged in, once i logged out it stopped updating the time and the drift returned.

I've been surfing IRC for answers and found none. Finally I sent an email to the dev and users ML's. Several other users reported the same issue, but no one supplied any answers.

Does anyone have any idea why this is happening?

Thanks

********
I fixed this by recompiling my kernel and disabling the apm settings in the BIOS. Never had an issue with this bios before running mdk so I didn't think to check til lae in the game. But somehow, the combination of those two things was screwing my system time all to hell. When I recomp'd the kernel I set HZ=100 fyi, that's all I changed.


Last edited by antifa on Mon Jul 22, 2002 3:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Jul 17, 2002 3:33 am    Post subject: Reply with quote

Anything of use in here?
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
antifa
n00b
n00b


Joined: 17 May 2002
Posts: 31

PostPosted: Wed Jul 17, 2002 3:46 am    Post subject: Reply with quote

newp, search was my friend and i tried everything in there *except* disbaling the ntp.drift file. Trying that now and i'll get back to people :) probably should just delete this though and add it to the other thread.

antifa
Back to top
View user's profile Send private message
antifa
n00b
n00b


Joined: 17 May 2002
Posts: 31

PostPosted: Wed Jul 17, 2002 6:11 pm    Post subject: ntpd.drift Reply with quote

ntp.drift file no help, disabled it and still the time is screwey.

*sigh*
Back to top
View user's profile Send private message
sawtooth
n00b
n00b


Joined: 13 Jul 2002
Posts: 5

PostPosted: Wed Jul 17, 2002 7:14 pm    Post subject: Reply with quote

Is the system going to any sleep or power saving modes after you log out? I had time drift being caused before by my bios taking my computer into a suspended mode, causing the software clock in linux to pretty much stop. hwclock was correct, but date would be stuck around the time it went to sleep. I've had luck compiling in some of the kernel options for energy saving (I can't check which ones at the moment, since I'm at work)
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Wed Jul 17, 2002 7:22 pm    Post subject: Reply with quote

I could never understand ntp for whatever reason, so I just setup cron to call 'rdate -s' with some public rdate server at ksu.edu every hour. Works for me. :p
Back to top
View user's profile Send private message
True
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2002
Posts: 125
Location: Vancouver

PostPosted: Thu Jul 18, 2002 7:19 am    Post subject: Reply with quote

NTP is not too complex..

create the file (if it doesn't exist) /etc/ntp.conf

put this in it:

server 216.244.192.3 <- some public ntp server found on google
driftfile /etc/ntp.drift


then set ntp to start at boot. You can't do ntpdate while ntp is running so you might need to do that first if your clock is way out - but it should just be the once.
Back to top
View user's profile Send private message
Aruspex
n00b
n00b


Joined: 28 Jun 2002
Posts: 51
Location: Brick, NJ

PostPosted: Thu Jul 18, 2002 2:11 pm    Post subject: Reply with quote

I'm sorry guys, I don't understand how anyone can see ntpd as an acceptable solution for a 12 hour time drift. The purpose of NTP is to fix small drifts over days.

Adding another factor into the problem will only make it harder to diagnose. Disable ntpd, download a vanilla kernel, compile it w/out anything fancy, and give that a shot.

Turn everything off you don't need until the problem goes away, then put one thing back at a time. Once you know what's causing the problem you can focus your energy on fixing it properly, rather than trying to hide it with a bandaid. :)
_________________
"If you want to make an apple pie from scratch, you must first create the universe" -Carl Sagan
Back to top
View user's profile Send private message
True
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2002
Posts: 125
Location: Vancouver

PostPosted: Thu Jul 18, 2002 3:53 pm    Post subject: Reply with quote

I think quite a few people have noticed clock drift under Gentoo. I somehow doubt (though I could be wrong) that it's anything to do with kernel configuration/version. Perhaps the clock daemon is askew or something. Anyway, recompiling the kernal and messing around seems a bit extreme when you could setup ntp in about 30 seconds and forget about it. I guess it depends on what's important to you. Maybe I'm just lazy.. ;-)
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Thu Jul 18, 2002 4:15 pm    Post subject: Reply with quote

True wrote:
I think quite a few people have noticed clock drift under Gentoo. I somehow doubt (though I could be wrong) that it's anything to do with kernel configuration/version. Perhaps the clock daemon is askew or something. Anyway, recompiling the kernal and messing around seems a bit extreme when you could setup ntp in about 30 seconds and forget about it. I guess it depends on what's important to you. Maybe I'm just lazy.. ;-)


Perhaps... I'm really concerned about this, myself. I haven't noticed it on any of my systems, however if this were to occur on my laptop it would be completely unacceptable. (They are not connected to the 'net all the time, and are used 'on the go' alot) Working in OpenOffice and having the correct time is kinda nice, especially if you use any kind of Revision Control System (rcs) to take care of your documents after you save them. (It logs timestamps and datestamps for documentation)
Back to top
View user's profile Send private message
antifa
n00b
n00b


Joined: 17 May 2002
Posts: 31

PostPosted: Thu Jul 18, 2002 6:32 pm    Post subject: ntp won't fix this Reply with quote

Thanks for all the replies.

First off, ntpd can only adjust time in steps, it can't do jumps. Hence, with drift this bad, ntpd will die (with no explanation other than synchronization lost) when the drift gets too bad. ntpd is for clock timing on the magnitude of a few seconds a day.

Second, I downloaded the vanilla sources but haven't had time ot redo the kernel yet.

And third, a few more details to add to the mix. Sitting at a console I seem to gain a bout 2.5 minutes an hour. I was monitoring to see if it was an X problem of some sort. The interesting thing is that once I start gdm, the clock immediately jumps backward by about 2.5 hours. I'm gona do a few more tests on that and i'll get back with any more relevant details.

Thanks.
Back to top
View user's profile Send private message
mrtaz65
n00b
n00b


Joined: 18 Jul 2002
Posts: 5

PostPosted: Thu Jul 18, 2002 7:05 pm    Post subject: Question Reply with quote

Do you have ide-scsi emulation enabled for a cd or cdrw drive?

The only reason I ask is that I found that with ide-scsi enabled on my burner, doing a cdparanoia -d /dev/sg1 1 to rip 1 track from the cd actually slows down my clock. for example:

Just an example, not real output

#date
Thu Jul 18 12:02:23 PDT 2002 (matches wall clock exactly)

# time cdparanoia -d /dev/sg1 1

(Lots of cdparanoia stuff)

real 0m8.053s
user 0m1.704s
sys 0m0.903s

#date
Thu Jul 18 12:02:31 PDT 2002 (This is now 16 seconds behind wall clock)

End example.

If I disable ide-scsi and reboot, using /dev/hdc with cdparanoia works fine and doesn't mess with the clock. Interesting, eh?
Back to top
View user's profile Send private message
antifa
n00b
n00b


Joined: 17 May 2002
Posts: 31

PostPosted: Thu Jul 18, 2002 7:42 pm    Post subject: more weirdness Reply with quote

Well, gdm isn't screwing up the clock when i start it anymore. Perhpas it could have something to do with the removal of the /etc/adjtime file. I'm going to let this run while I go to my job interview and see how it does. And no I don't have ide-scsi emulation running. That's so strange that it would mess with the clock anyway.

antifa
Back to top
View user's profile Send private message
Belboz
n00b
n00b


Joined: 21 Jun 2002
Posts: 20

PostPosted: Thu Jul 18, 2002 8:54 pm    Post subject: Reply with quote

I've noticed my system clock loses time when I run vmware.

I freuently use Nero under vmware to burn svcd's and the system clock is always slow afterwards.

I usually set the system clock from the hardware clock with hwclock after running vmware.

I haven't tried any other cpu intensive things to see if they too effect the system clock.

I do have the kernel prempt and latency options selected. Not sure if this problem existed before I switched to those settings.

Running on an AMD 1GHz machine by the way.
Back to top
View user's profile Send private message
antifa
n00b
n00b


Joined: 17 May 2002
Posts: 31

PostPosted: Thu Jul 18, 2002 11:39 pm    Post subject: newp, not done yet Reply with quote

well, the /etc/adjtime file didn't solve it. I let the comp sit at the gdm login screen while i was away. Came back and it was half an hour slow this time after about an hour away. I watched it roll back a minute while i was logging in.

*sigh*

back to the drawing board. Maybe I'll give the vanilla sources a try tonight.

antifa
Back to top
View user's profile Send private message
bobo
n00b
n00b


Joined: 18 Jul 2002
Posts: 10

PostPosted: Fri Jul 19, 2002 12:00 am    Post subject: Reply with quote

It took me ages to crack this one. After various messing around I had a silly /etc/adjtime file and a suspect /etc/ntp.drift file (both nuked.)

After fixing these I was still losing time and gave up on it for a couple of days until I got around to investigating brief "hangs" during disk activity and generally poor disk performance. It turned out that I had not enabled DMA for my chipset in the kernel. A new, clean kernel with DMA enabled also seems to have fixed the time. Is it conceivable that my kernel was losing jiffies during PIO disk access?
Back to top
View user's profile Send private message
antifa
n00b
n00b


Joined: 17 May 2002
Posts: 31

PostPosted: Fri Jul 19, 2002 2:57 pm    Post subject: jiffies Reply with quote

Well, i recompiled the kernel yet again last night, set the jiffies to 100 instead of 1000, and still i'm loosing time.

It really only seems to happen when I'm sitting at the gdm login screen. I'm going to leave myself logged in today and see if that is any different.

Running out of ideas here.

antifa
Back to top
View user's profile Send private message
antifa
n00b
n00b


Joined: 17 May 2002
Posts: 31

PostPosted: Fri Jul 19, 2002 8:52 pm    Post subject: Reply with quote

I left the computer sitting here logged in all day long, got back and the time was about 285 minutes slow. I left at 9:10am and returned at 2:15pm. Hence when I got back the time read 9:30am.

So everything mentioned so far has been tried and yet no results, no effect on the time drift. Anyone got some wacky hairbrained ideas to try? All the sensible ones so far haven't panned out lol.

antifa
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Jul 19, 2002 8:59 pm    Post subject: Reply with quote

antifa wrote:
So everything mentioned so far has been tried and yet no results, no effect on the time drift.


I'm assuming you haven't done rdate then? Assuming you can connect to a public rdate server (I can't from work, cursed firewall), this would fix your problem. Obviously you would need to run it more often if your clock is naturally drifting a lot. Depends how far off you are being comfortable with. If you are comfortable with the ~2 minutes you are losing every hour, then have it run every hour or maybe 30 minutes. AFAIK, rdate -s is a pretty light operation.
Back to top
View user's profile Send private message
rommel
Veteran
Veteran


Joined: 19 Apr 2002
Posts: 1145
Location: Williamsburg Virginia

PostPosted: Fri Jul 19, 2002 9:06 pm    Post subject: Reply with quote

excuse the crash of this thread but after reading the posts i am confused as to what is actually happening.

is the actual time displayed in windows environment like gnome or kde off that much after you reset it?

have you tried a clean re-install of gentoo?
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Fri Jul 19, 2002 9:13 pm    Post subject: Reply with quote

Re:
rizzo wrote:
...
I'm assuming you haven't done rdate then?...


See top of thread:
Quote:

...
I also tried setting a cron job to 'rdate -s ntpserv' every 15 minutes, but it would only update the system time if i was logged in, once i logged out it stopped updating the time and the drift returned...


cron runs regardless of whether you are logged in or not. APM related?
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Jul 19, 2002 9:21 pm    Post subject: Reply with quote

Yes I totally missed that in my first and second posts. Hmph.

Anyway as Naan said cron should continue running whether or not you are logged in. That is what cron is all about, after all.
Back to top
View user's profile Send private message
Belboz
n00b
n00b


Joined: 21 Jun 2002
Posts: 20

PostPosted: Fri Jul 19, 2002 9:24 pm    Post subject: Reply with quote

Funny thing about my vmware issue noted above....

When I have vmware loaded and the system clock on Gentoo is slow (sometimes by as much as 15 minutes to an hour) the Windows time listed in the Windows task bar (under vmware obviously) is correct!

But the time listed in fluxbox's taskbask and gkrellm is off.

I know somebody else mentioned ide-scsi and I will say when I lose time under vmware it is when I am using Nero to burn SVCD's so it is obviously going through the ide-scsi emulation.

Very wierd.
Back to top
View user's profile Send private message
antifa
n00b
n00b


Joined: 17 May 2002
Posts: 31

PostPosted: Fri Jul 19, 2002 9:52 pm    Post subject: Reply with quote

well, after some thought, i'm thinking that the time is being lost rapidly enough that cron ceases to run. I mean, how can cron calculate when it's been 15 minutes and it's time to run again when the system looses an hour every hour? or in some cases 12 hours inside an hour? That's what i think happened there.

that also must be why the screen blanks when the time updates, it thinks it's time to turn on the screensave.

I think perhaps, as sad as it sounds.....a complete reinstall may be in order....i gotta back up first though, and i have no idea when the next time i will have 4 days free to do it is - so for now, i'll keep trying things.

antifa
Back to top
View user's profile Send private message
io333
n00b
n00b


Joined: 20 Jul 2002
Posts: 49

PostPosted: Sat Jul 20, 2002 5:00 am    Post subject: Perhaps KDE is causing the problem? Reply with quote

Hi all, I'm at this moment emerging KDE on my first ever Gentoo build (well second really, the first one died with the circular dependencies problem).

On my regular box though, I've been running Mandrake for about 2 years. Currently it's running 8.2. I never had a problem with time.

However, I recently reinstalled Mandrake 8.2 minimally, and then added KDE3.00. Ever since then, my clock in Mandrake has been wacko. The machine is dual boot with windows however, and when I boot over to the windows side, the clock is correct. I NEVER had the problem before installed KDE3.

I did a google groups search, and it turns out LOTS of people are having a KDE3 time drift problem.

So don't necessarily blame Gentoo, and also don't think a rebuild will necessarily fix things.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
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