[Dovecot] old master.pid prevents dovecot startup
Michael
dovecot2008 at mth.com
Wed Jan 16 18:57:41 EET 2008
> It does check if a process is running with that PID. Doing any further
> checks to make sure that the PID is a dovecot process would probably be
> more trouble than worth.
Hmmm ... something strange must have happened, because it sure looks like
to me that the test failed.
Dovecot reported that the old PID was 1965. Per my previous message, I did
a 'ps 1965' and saw no processes:
----
[root at mykiss5 mth]# service dovecot start
Starting Dovecot Imap: Error: Dovecot is already running with PID 1965
(read from /var/run/dovecot/master.pid)
Fatal: Invalid configuration in /etc/dovecot.conf
[FAILED]
[root at mykiss5 mth]# ps 1965
PID TTY STAT TIME COMMAND
[root at mykiss5 mth]# rm /var/run/dovecot/master.pid
rm: remove regular file `/var/run/dovecot/master.pid'? y
[root at mykiss5 mth]# service dovecot start
Starting Dovecot Imap: [ OK ]
----
Once I manually removed /var/run/dovecot/master.pid it started up.
*** 5 minutes later ***
Well, I just tried to reproduce this by hand, but was not able to.
----
[root at mykiss5 mth]# cd /var/run/dovecot/
[root at mykiss5 dovecot]# ls
auth-worker.3053 dict-server login master.pid
[root at mykiss5 dovecot]# ls -l
total 12
srw------- 1 root root 0 2008-01-16 10:53 auth-worker.3053
srwxrwxrwx 1 root root 0 2008-01-16 10:53 dict-server
drwxr-x--- 2 root dovecot 4096 2008-01-16 10:53 login
-rw------- 1 root root 5 2008-01-16 10:53 master.pid
[root at mykiss5 dovecot]# cp master.pid master.pid.backup
[root at mykiss5 dovecot]# service dovecot stop
Stopping Dovecot Imap: [ OK ]
[root at mykiss5 dovecot]# ls -l
total 12
srwxrwxrwx 1 root root 0 2008-01-16 10:53 dict-server
drwxr-x--- 2 root dovecot 4096 2008-01-16 11:49 login
-rw------- 1 root root 5 2008-01-16 11:49 master.pid.backup
[root at mykiss5 dovecot]# ps `cat master.pid.backup`
PID TTY STAT TIME COMMAND
[root at mykiss5 dovecot]# mv master.pid.backup master.pid
[root at mykiss5 dovecot]# service dovecot start
Starting Dovecot Imap: [ OK ]
[root at mykiss5 dovecot]# ls -l
total 12
srw------- 1 root root 0 2008-01-16 11:50 auth-worker.3855
srwxrwxrwx 1 root root 0 2008-01-16 11:50 dict-server
drwxr-x--- 2 root dovecot 4096 2008-01-16 11:50 login
-rw------- 1 root root 5 2008-01-16 11:50 master.pid
[root at mykiss5 dovecot]#
----
I have no idea why it failed after the unclean shutdown/restart ...
curiouser and curiouser.
Michael
More information about the dovecot
mailing list