server time wont stay at the correct time

tarquel

Verified User
Joined
Nov 6, 2006
Messages
106
Location
Mid-Wales, UK
Hi all

Having a big problem with keeping the server time at the correct time.

For some reason, the time either lags or goes faster than the actual time.

The hardware clock appearently stays at the correct time, but the system/OS clock doesnt. This is causing one of my new customers big problems on their forum and they are a bit annoyed so I'm racking my brains trying to work out what it is.

I've tried creating a hourly cronjob as Jeff mentions here:

http://www.directadmin.com/forum/showthread.php?s=&threadid=7484&highlight=sync+time

and I've tried just manually setting it without ntp, but it keeps happening continually.

Its not any time of the day, its all times of the day and it does the same after a reboot - been like this since the begining, but I never thought it would cause so much hassle or be such a big problem [lesson learned here].

I'm thinking that it might be a bug in the kernel but i'm worried that in updating the kernel and rebooting the server, the thing may not come on again hehe ;)

Anyone got any thoughts? as I want to get it fixed as soon as i possibly can.

Cheers
Nath.
 
I have the same thing happening aswell and have set a cron for it.

Not sure if this is related to that although I thought id mention it incase it leads to further problems. The past week my server has had a kernal panic and the last cron was updating the time.
 
Is the server losing or gaining time? While it's running?

If so check to see if you're running the ntpd daemon or any other time daemon? If so, make sure you've got the latest version installed and running.

Otherwise you might want to check with a forum devoted to your OS distribution, as it's not a DA related issue.

Jeff
 
I am having same issues here too ... running centOS 4.4

It is also causing problems with some clients, and I also lost a client over it last week :mad: .... not to mention that I receive 20-30 emails a day from the server telling me that 'directadmin' and/or 'mysql' services are down -- when they are not, and my SA thinks that this is caused by the server's inability to keep time too!
 
This is how I do it and it's worked pretty well:

Code:
15 * * * 5 /usr/sbin/ntpdate us.pool.ntp.org >/dev/null 2>&1
20 * * * 5 /sbin/hwclock --systohc >/dev/null 2>&1

Syncs time with the ntp pool server once a week, then makes the hardware clock sync to it a few mins later. You can adjust the cron time as you'd like.
 
Is it a physical server or a virtual machine. VMware Linux guests are renowned for having their time skew.

Go with ntp... it's reliable and works.
 
Back
Top