/scripts/upcp killing dovecot??

CormoranTick

Registered
Jan 28, 2011
1
0
51
Ontario, Canada
I recently started getting alert emails from my server at 3am saying that dovecot wasn't running. It restarts the service and all is well, but every day around 3am dovecot kept dying. I checked the log files and /var/log/maillog reports this:

Jan 28 03:07:14 <hostname> dovecot: dovecot: Fatal: Time just moved backwards by 170 seconds. This might cause a lot of problems, so I'll just kill myself now. http://wiki.dovecot.org/TimeMovedBackwards
This confused me because I am not running any type of NTP service on my server and the date shouldn't be spontaneously changing itself. After a little bit more checking I realized that /scripts/upcp was running right around 3am as well and that it's log file includes:

Setting Clock......Done
I can't find anything else that would be running/doing anything at 3am that would cause a time change so my conclusion is that /scripts/upcp is doing it. The way I see it I have three choices:
  1. Do nothing and let dovecot die and restart every day at 3am
  2. Disable /scripts/upcp completely
  3. Stop /scripts/upcp from changing the time

I don't know which is more ideal, but it would seem easy enough to comment out these lines in /scripts/upcp:

Code:
$output .= Cpanel::WHMAPI::setstatus('Setting Clock');
$output .= Cpanel::WHMAPI::status_cmd( '/usr/bin/rdate', '-s', 'rdate.cpanel.net' );
$output .= Cpanel::WHMAPI::setstatusdone();
Has anyone encountered this before or does anyone know what the effects of commenting out these lines will be? Are there any other potential solutions?

Thanks.
 

Eric

Well-Known Member
Nov 25, 2007
754
14
143
Texas
cPanel Access Level
Root Administrator
Twitter
Howdy,

The real problem is the server is losing time somewhere. As part of upcp rdate is run each day; as little as 5 seconds can cause dovecot to die. I recommend setting up a postupcp hook to restart dovecot, or simply enable server monitoring to take care of it each night.

I personally have this problem on my VPS machines and ended up just switching over to courier, as it does not have this problem.

Thanks!
 

mikelegg

Well-Known Member
Mar 29, 2005
330
3
166
I recently fixed this problem by ensuring NTP was running properly. (See ntp.org: Home of the Network Time Protocol)

NTP makes minor adjustments to your clock to slowly bring it into line with the reference clock that you configure.

This in turn means that when upcp runs the rdate function the resulting time change is smaller and therefore less likely to upset Dovecot. (Dovecot seems to tolerate changes less than 5 seconds)
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator