On Tue, 1 Jul 2008, Timo Sirainen wrote:
$ /sbin/service dovecot start Starting Dovecot Imap: Error: Dovecot is already running with PID 10825 (read from /var/run/dovecot/master.pid) Fatal: Invalid configuration in /etc/dovecot.conf [FAILED] (Note: there is nothing wrong in the configuration file so the error message is somewhat misleading.)
Yes, it's a bit misleading. But I don't think I'll bother fixing it before rewriting the master/config handling for v2.0.
Is this already a known problem? Should the start-up logic be made more robust (e.g. check whether a process corresponding to the PID actually exists)?
It already checks if the PID exists, but it doesn't check what that process is (and I don't think there is a portable way to do it anyway). I don't think it's too much to ask to delete the master.pid if in rare situations it fails to start due to a PID conflict.
Getting back to this after another power loss.
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
-- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings