1

I have a postfix MTA with dovecot for pop3/imap etc.. The server's RTC is horrible and is about 10 min fast every month, but this is an annoyance when dealing with logs and because people rely on timestamps in email. I've dealt with this for the last two years using ntp, but I just noticed it stopped working about 3 months ago.

I know that if I move back the time, I'll cause this failure on dovecot. What's the quickest way to come back from that problem? I've seen tons of mentions in google searches about it, and the closest I've found is to restart the server, which I'm trying to avoid (It's an old POS, there's no money here to put into a mailserver)

outofluck
  • 23
  • 5

3 Answers3

0

Not so out of luck yet. It will keep failing until the time shift is less than 5 seconds IIRC. If I understood you right, your time is off now by about 30 minutes, do confirm if that's not the case. What I would do is schedule overnight downtime, and use an at job or something to change the time then, and then just wait. Depending on how you have dovecot running (which OS, how it starts/is monitored etc) it'll keep trying to start until successful.

If 30 minutes down overnight is not an option, you can try going with a gradual step-by-step increase in time, but in the end, you'll have no choice but to wait, or reboot as you've indicated from google searches. Off the top of my head, I suppose you can catch up by 5 minutes every night for a week, and you're done. The real (longterm) solution here though is you need to find a better way to manage the time drift on that machine.

This is something that I was affected by back when the Bush administration changed how DST would be observed, right at this time of the year, coincidentally.

sandroid
  • 1,724
  • 12
  • 16
  • 1
    hmm.. i may do it gradually, as much as it sounds like a hackjob. It's just a personal server I dick around on, but I try to avoid the easy "microsoft" fix ;). Are you suggesting to write a shell script that would bump the time back 5 minutes and add it as a cronjob? – outofluck Oct 31 '11 at 21:29
  • I dunno, I'd just bite the bullet and call it a maintenance window - granted you mentioned it's not a real prod server, so there's no concern for maintenance windows per se anyway. Don't forget, mail will still come in, it's just the users' access to imap that will not work for a while. – sandroid Oct 31 '11 at 21:32
0

You can pass ntpd the -x option, which will cause it to slew the time (run the clock .05% fast or .05% slow) rather than jumping it backwards. If your clock is 30 minutes off, it will take about 40 days of running the clock slow for it to catch up.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84
0

Ntp didn't stop working. For me it works very well at the moment. So if ntp worked for you for years you should really fix that.

You only have two options

  1. Replace the server. You are not going to do that, so...
  2. Synchronize the time. This is done by ntp as a network based reliable source. Otherwise you need other reliable sources for time. This is either a DVB receiver, GPS system, GSM provider, DCF77 (Europe) WWV (USA) radio signal or something similar.
mailq
  • 17,023
  • 2
  • 37
  • 69