[BlueOnyx:07372] Re: Dovecot shutting down
Ken - Precision Web Hosting, Inc
kenlists at precisionweb.net
Tue May 24 19:37:08 -05 2011
----- Original Message -----
From: "Taco Scargo" <taco at blueonyx.it>
To: "BlueOnyx General Mailing List" <blueonyx at mail.blueonyx.it>
Sent: Tuesday, May 24, 2011 4:47 PM
Subject: [BlueOnyx:07371] Re: Dovecot shutting down
> What hypervisor are you using?
> If it is KVM on AMD processors you are out of luck.
>
> With regards,
>
> Taco Scargo
> taco at blueonyx.it
>
>
> On 24 mei 2011, at 23:22, Gregg wrote:
>
>>> On 24 May 2011, at 21:58, Gregg wrote:
>>>> I have been having an issue with dovecot shutting down and not coming
>>> back
>>>> up right away. I know this is happening because I have the server
>>> checking
>>>> for time and sometimes it moves backwards.
>>>
>>> Use NTP, rather than something that does stepping.
>>>
>>>> The problem is, it takes dovecot a lot longer than 13 seconds to come
>>> back
>>>> on, sometimes more than 30 minutes. Is there a way for me to have the
>>>> dovecot process come back up any sooner?
>>>
>>> Easier to fix the cause than the result.
>>
>> I was having it check the time with one of my own servers, since it is a
>> virtual machine, it loses time a bit, but I was checking it maybe too
>> often,
>> every 5 minutes, maybe I will try to let ntp handle it directly from the
>> GUI?
>>
You could just check the dovecot and restart it with a cron like:
*/2 * * * * /root/restartdovecot.pl
#!/usr/bin/perl
##################################################################
# checks the dovecot processes and restarts if necessary
$maxprocesses = 50;
$running = "no";
$poprunning = "no";
$thecount = 0;
########################################
@ps =`ps auxwwwww | grep imap-login`;
$aps = "@ps";
foreach $line (@ps){
if ( ($line !~ /defunct/) and ($line !~ /grep/) ) {
#print "All is well\n";
$running = "yes";
}
}
#######################################
@ps =`ps auxwwwww | grep pop3-login`;
$aps = "@ps";
foreach $line (@ps){
if ( ($line !~ /defunct/) and ($line !~ /grep/) ) {
#print "All is well\n";
$poprunning = "yes";
}
}
if ( ($running eq "no") or ($pop3running eq "no") ){
print "dovecot problem \n";
system ("/etc/rc.d/init.d/dovecot restart");
}
###########################################################################
# checks the maillog to see if we need to restart dovecot
$count =`tail -100 /var/log/maillog | grep "Memory buffer error" -c`;
if ($count > 0) {
print "Memory buffer error. Restarting dovecot";
system ("/etc/rc.d/init.d/dovecot restart");
}
###########################################################################
$processcount =`ps fauxw | grep dovecot -c`;
$toomanyprocesses = "no";
if ( $processcount > $maxprocesses ) {
print "Too many dovecot processes. Will restart\n";
$toomanyprocesses = "yes";
system ("/etc/rc.d/init.d/dovecot restart");
}
More information about the Blueonyx
mailing list