[Dovecot] Server power loss and "Dovecot is already running with PID xxx"

Pekka Savola pekkas at netcore.fi
Mon Aug 4 12:40:55 EEST 2008


On Mon, 4 Aug 2008, Timo Sirainen wrote:
>> It doesn't seem to be that the current logic is working; there is no 
>> program with the PID that's in master.pid, and dovecot (1.0.7 + RHEL 
>> patches) refuses to start.
>> 
>> root: /root$ /sbin/service dovecot start
>> Starting Dovecot Imap: Error: Dovecot is already running with PID 2746 
>> (read from /var/run/dovecot/master.pid)
>> Fatal: Invalid configuration in /etc/dovecot.conf
>>                                                           [FAILED]
>> root: /root$ more /var/run/dovecot/master.pid
>> 2746
>> root: /root$ ps auxw | grep 2746
>> root     31714  0.0  0.1   4116   584 pts/1    R+   20:19   0:00 grep 2746
>
> SELinux perhaps? It checks this by kill()ing the process and seeing if it 
> returns ESRCH. If not, it assumes the process exists. If you've SELinux 
> perhaps it always return EPERM to the call..

'getenforce' says disabled, so no.  This is pretty strange -- I looked 
at the code and basically duplicated the logic there and could not 
reproduce this problem with a smaller piece of code.  And it doesn't 
seem to appear always in any case -- I killed dovecot with KILL signal 
(leaving the PID file behind), and after that it started up without 
problems.  Unless you have other ideas what to look for, I guess this 
will remain a mystery..

-- 
Pekka Savola                 "You each name yourselves king, yet the
Netcore Oy                    kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings


More information about the dovecot mailing list