View Full Version : [ubuntu] Adjust system time -- problematic?
lodp
June 4th, 2008, 07:19 AM
I noticed that on my rented Ubuntu web server the clock runs 10 minutes ahead. It's not disruptive or anything, but it's a nuissance.
Is there a way to synchronize the time with a central source somehow? I know the GUI way to do this -- but how can I do this on command line on my remote server?
Also, am I likely to run into any problems when setting the time back? Do I have to watch out for anything?
wdaniels
June 4th, 2008, 07:21 AM
Try:
sudo ntpdate ntp.ubuntu.com
There shouldn't be any issues with moving it just ten minutes, or not that I can think of...
lodp
June 4th, 2008, 09:26 AM
thanks! worked like a charm, and no problems so far..
i guess i'll run this on a cronjob, once a week or so.
koenn
June 4th, 2008, 12:40 PM
Do I have to watch out for anything?
Yes : lots of stuff is time related. That's why it's such a good idea to use time servers (ntp). some examples : changing the time back can have an effect on
- all log files that record the time an event occurred.
- jobs that look at file modification times, such as most backup jobs
- some authentication schemes, such as Kerberos tickets
- cron jobs - soe jobs might run twice
10 minutes isn't that much, but you're log files may show events in a peculiar order, so if you happen to have a problem, using the log to diagnose it is going to be harder, stuff like that. Just something to keep in mind for the next couple of days.
lodp
June 4th, 2008, 01:42 PM
- all log files that record the time an event occurred.
- jobs that look at file modification times, such as most backup jobs
- some authentication schemes, such as Kerberos tickets
- cron jobs - soe jobs might run twice
Thanks for those .. i'll keep in mind the thing with the logs.
So far there's only one immediate problem that I noticed: fetching mails with POP3 didn't work any more. Turns out dovecot didn't like the time change:
quoting from /var/log/mail.log:
Jun 4 15:22:46 host dovecot: Time just moved backwards by 614 seconds. This might cause a lot of problems, so I'll just kill myself now. http://wiki.dovecot.org/TimeMovedBackwards
I started dovecot and it's working now. What's weird is that a test message that I sent to one of my accounts before doing that didn't arrive. The message didn't bounce or anything, it just didn't get there. not showing up in the mail log either. I didn't think dovecot not running could be responsible for such a thing..
Edit: I found that there's actually a package called plainly ntp, which runs a daemon to keep the time in sync. Very nice.
koenn
June 4th, 2008, 02:09 PM
I didn't think of mail handling, but I can sort of understand how timeouts and retry mechanisms may be affected, and I've seen other programs complain about having to handle files swith creation dates in the future, so the dovecot wiki page makes sense.
ntpd is definitely a good idea
vBulletin® v3.7.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.