Is it just me or is time actually slowing down?

Place to discuss Slackware
Post Reply
Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Is it just me or is time actually slowing down?

Post by Master of Reality » Wed Jan 07, 2004 7:12 am

er.. Twice this week i have looked at the clock on my computer and then at another clock in my room, and my computer was over 30minutes slow!
I'm wondering what could cause my computer clock to lose track of time like this?
This is on Slackware9.1 with Linux 2.6.0

Membrax
scripter
scripter
Posts: 99
Joined: Tue Oct 21, 2003 2:04 pm
Location: 50'48''N - 4'21''E
Contact:

Post by Membrax » Wed Jan 07, 2004 9:27 am

Hi buddy,

Imho, you should replace the battery on your mobo.
It's one of the many components which handles the hardware clock of a system.

In 99,9% of the cases it'll be a "CR-2032" battery.

Keep me informed if that was the solution.

Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Post by Master of Reality » Wed Jan 07, 2004 10:53 am

i thought that may be it but i wasnt sure... ill try replacing it.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 07, 2004 11:47 am

You may already know this but setting the system time does no automatically update your hardware clock, so if your machine is 30 minutes slow and you then set it to the correct time with the "date" command (or similar) and you then reboot your machine, when it comes back up it will be 30 minutes slow again. In order to update the hardware clock you need to set the system time and then sync the hardware clock with it by using the "/sbin/hwclock --systohc" command.

Of course computer clocks don't keep all that great of time regardless which is why I use ntpd and also sync the hardware clocks every day via cron.

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum » Wed Jan 07, 2004 2:18 pm

i'm 20 minutes slow too :-(

Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Post by Master of Reality » Wed Jan 07, 2004 2:38 pm

Void Main wrote:You may already know this but setting the system time does no automatically update your hardware clock, so if your machine is 30 minutes slow and you then set it to the correct time with the "date" command (or similar) and you then reboot your machine, when it comes back up it will be 30 minutes slow again. In order to update the hardware clock you need to set the system time and then sync the hardware clock with it by using the "/sbin/hwclock --systohc" command.
I havent restarted my computer in over a week. The system clock never syncronizes with the hardware clock except at boot time? So would that not make it just the system clock that is slow? and possibly not the hardware clock.

I should use ntp... are you just using the redhat ntp server void? Or NASA, etc?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 07, 2004 3:04 pm

I just use the one that comes with the distro. All I have to do is give it a server to sync off of in a config file. And yes, the only time the hardware clock is polled is at boot time to initialize the system clock so I don't think that a battery should cause your system clock to run slow. I have seen them get pretty out of whack but not that bad that fast. Usually it takes a couple of months or more to get that far off.

You can also just run "ntpdate" against a remote time server often. which doesn't "keep" the time on track, rather it just is a one time set the time. It's usually not a good idea to make instant drastic changes to the system clock on *NIX systems. It should be done gradually which is what ntpd will do. Of course ntpdate can be used at boot time to initially set the clock against a remote server prior to starting ntpd (and this is what is done in Red Hat's ntpd init script).

Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Post by Master of Reality » Wed Jan 07, 2004 3:15 pm

Does ntpd query the server at random times? The documentation at ntp.org isnt too clear on that.

I suppose ill have to make port forward in my firewall to allow ntp through as well.

Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Post by Master of Reality » Wed Jan 07, 2004 3:25 pm

Code: Select all

root@bleh:~# ntpdate
 7 Jan 16:19:38 ntpdate[8695]: no servers can be used, exiting
Would you happen to know what the problem could be with this?
I have in my ntp.conf a few servers defined, and am not sure what else needs to be done?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 07, 2004 3:28 pm

If you run the ntpdate command manually you have to give it a server as a parameter. It doesn't read any conf files. Your startup script probably reads the conf file and passes the servers to ntpdate as parameters. See "man ntpdate" or look at your startup scripts.

Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Post by Master of Reality » Wed Jan 07, 2004 3:44 pm

ahh i seee, i was under the impression it read the ntp config file

Post Reply