Time a day behind - ntpd fixes it

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
User avatar
rymax99
This is my homepage
This is my homepage
Posts: 143
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun Feb 02, 2014 2:08 pm
Location: Florida
Contact:

Time a day behind - ntpd fixes it

Post by rymax99 »

So I went into check my server logs (game server) and what not, and I notice that things aren't rotating on the correct time sequence, (daily, etc), logs seem to have stopped on 5/18/14, so somehow before 12 AM EST today the time drifted back a day. Here's some logs from SSH where it seems to miracuously drift back. I ran ntpd, and that seems to have fixed it. It was drifted by an entire day, here's the logs from SSH when I 'fixed' it:

Code: Select all

root@s1:/var/log# date
Mon May 19 21:38:48 EDT 2014
root@s1:/var/log# date +%r
09:39:03 PM
root@s1:/var/log# dpkg-reconfigure tzdata

Current default time zone: 'America/New_York'
Local time is now:      Mon May 19 21:39:56 EDT 2014.
Universal Time is now:  Tue May 20 01:39:56 UTC 2014.

root@s1:/var/log# date +%r
09:40:02 PM
root@s1:/var/log# ntpd
root@s1:/var/log# date +%r^C
root@s1:/var/log# date +%r
09:40:11 PM
root@s1:/var/log# date
Mon May 19 21:41:33 EDT 2014
root@s1:/var/log# service ntp restart
[ ok ] Stopping NTP server: ntpd.
[ ok .] Starting NTP server: ntpd.
root@s1:/var/log# date +%r
09:41:55 PM
root@s1:/var/log# date
Tue May 20 09:47:07 EDT 2014
root@s1:/var/log# date
Tue May 20 09:47:08 EDT 2014
root@s1:/var/log# date
Tue May 20 09:47:54 EDT 2014
root@s1:/var/log# date
Tue May 20 09:48:03 EDT 2014
root@s1:/var/log# date +%r
09:48:15 AM
Any idea on a more permanent solution? I can't have this happening, I have 10+ cron jobs that rely on the time, as well as log rotations, etc. Not to mention things in my SA-MP script that rely on the time such as donor giveaways.
User avatar
Edge100x
Founder
Founder
Posts: 13156
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Time a day behind - ntpd fixes it

Post by Edge100x »

I recommend running ntpd continuously as a permanent fix (it's meant to correct time drifts).
User avatar
rymax99
This is my homepage
This is my homepage
Posts: 143
Joined: Sun Feb 02, 2014 2:08 pm
Location: Florida
Contact:

Re: Time a day behind - ntpd fixes it

Post by rymax99 »

Edge100x wrote:I recommend running ntpd continuously as a permanent fix (it's meant to correct time drifts).
What's the cause of this? I've never had this problem, at least on OpenVZ systems. It's odd that it was exactly 12 hours behind. Have you seen it a lot, perhaps a XEN bug?

Would running this daily via cron be a good solution?
User avatar
Edge100x
Founder
Founder
Posts: 13156
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Time a day behind - ntpd fixes it

Post by Edge100x »

If was a large, sudden jump and not just a general drift, it could be that you need to change the time zone to your preferred one (through the "Server control" page). Or, a Xen bug might be involved that we can correct: http://www.nfoservers.com/forums/viewto ... =47&t=7879. Please open a support request if that is the case.
Post Reply