Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a Debian webserver that I am trying to use ntpdate to keep the time in sync.

When I run

ntpdate ntp0.cs.mu.oz.au

I receive

16 Sep 10:55:36 ntpdate[21626]: step time server 128.250.36.2 offset 318.914011 sec

With no errors, which should be a good thing, I think...

When I check the time again though, it's not changed.

I am also unable to set the time manually using

date --set 11:00:00

So I have a feeling there are other issues.

Any advice would be appreciated.

Update

Sorry for the bum steer guys, this machine is a XenServer VM, which I managed to forget.

After updating the Host clock, the VM time is now correct.

Thanks for your replies. Thanks.

share|improve this question
    
Not related to the original request, but... note that ntp0.cs.mu.oz.au has now been discontinued and stopped responding to queries. I suggest using au.pool.ntp.org instead. –  Wilson Jan 15 '10 at 6:39

5 Answers 5

up vote 9 down vote accepted

I have been through this before.

Try (on domU):

echo 1 > /proc/sys/xen/independent_wallclock

and try updating the time again.

share|improve this answer
    
Nice one, thanks. –  LukeR Sep 16 '09 at 7:57

Have you given it time? Generally ntp will slowly adjust the time so when you look at logs things still make sense, and applications don't get messed up. This is called slewing, you can read about it in 'man ntpdate' or RFC 1305.

"Time adjustments are made by ntpdate in one of two ways. If ntpdate determines the clock is in error more than 0.5 second it will simply step the time by calling the system settimeofday() rou‐ tine. If the error is less than 0.5 seconds, it will slew the time by calling the system adjtime() routine. The latter technique is less disruptive and more accurate when the error is small, and works quite well when ntpdate is run by cron every hour or two."

share|improve this answer
    
With date are you running it as root? –  Kyle Brandt Sep 16 '09 at 1:32
    
yep, eveything is run as root. –  LukeR Sep 16 '09 at 1:39
    
How long should it take? It doesn't appear to have changed in the last .5 hour. I'm still seeing the same offset 318.9... secs –  LukeR Sep 16 '09 at 1:42

Did the time change when you set the new time using date?

Try and check the machine hardware clock. (man hwclock)

share|improve this answer
    
no. I am unable to set the date with either ntpdate or date –  LukeR Sep 16 '09 at 1:43

Try running ntpdate on an unprivileged port (in case you are running ntpd), otherwise it will refuse make any changes.

ntpdate -u ntp0.cs.mu.oz.au
share|improve this answer
    
no dice. still no changes –  LukeR Sep 16 '09 at 2:57

Try by this procedure:

Stop the ntpd service first:

service ntpd stop

Now update the local time

ntpdate "server name"

and after this start the service:

service ntdp start
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.