Well, it was this morning. I didn’t realize it until I went to schedule a blog post for 12 hours later and it published immediately. I was concerned and actually went to blame WordPress first (I’m really not sure why). However, when I was looking at the time preferences in the General settings area of the site I noticed something really strange. My timezone was correct, but the date WP was showing was way off. This meant that my CentOs5 server’s time was way off.
I did a little research and found an article called “Setting the time of your system“. They gave me some good solutions on how to fix the issue, after reading it I was ready to go. I tried a couple things in the order they said and found myself a little confused. So naturally, I started trying things till they worked. This is not always the best solution, but I figured I could deal with a timing issue if I messed it up worse than it was.
For my CentOs 5 server I did the following, which actually worked and set the time perfectly.
First, I checked the date the server had, which turned out to be way off.
-
# date
-
Thu Nov 12 23:56:41 MST 2009
Then I looked to see if ntpd (the automatic time adjustment service) was running, it was.
-
# service ntpd status
-
ntpd (pid 12019) is running…
I tried ntpdate to reset the time on the server, but it complained about the socket being in use.
-
# ntpdate 129.6.15.28
-
12 Nov 23:57:28 ntpdate[12045]: the NTP socket is in use, exiting
My solution was to stop ntpd and then run ntpdate again, which worked!
-
# service ntpd stop
-
Shutting down ntpd: [ OK ]
-
-
# ntpdate 129.6.15.28
-
12 Nov 07:25:10 ntpdate[12063]: step time server 129.6.15.28 offset -59562.023808 sec
A simple restart of the ntpd service and the time was correct!
-
# service ntpd start
-
Starting ntpd: [ OK ]
-
-
# date
-
Thu Nov 12 07:25:20 MST 2009
So, the solution was to do the following steps:
-
# service ntpd stop
-
# ntpdate 129.6.15.28
-
# service ntpd start
-
#date
I added “date” on the end, because you want to verify that the time actually did reset. Best of Luck!
Tags: automatic time, best solution, centos 5, ntpdate, step time, time adjustment, time preferences, time server, timezone, timing issue
Sphere: Related Content