Red Hat Bugzilla – Bug 986045
dovecot imap sometimes fails to start because another service has taken the IMAPS port
Last modified: 2013-08-14 07:08:02 EDT
Description of problem:
dovecot starts up pretty late in the boot process (S65 in runlevel 3). So sometimes another service that binds to a random port (NFS in our case) starts up before it, and binds to a port that dovecot wants to use. Consequently, dovecot will not start.
Version-Release number of selected component (if applicable):
Some (small) fraction of the time.
Steps to Reproduce:
1. Install dovecot and configure it to listen on the imaps port.
2. Start up the system.
Sometimes another process will bind to port 993 before dovecot and so it won't start up. Trying to start it manually also won't work:
# /sbin/service dovecot start
Starting Dovecot Imap: Error: service(imap-login): listen(*, 993) failed: Address already in use
Fatal: Failed to start listeners
(I guess you could force this to happen 100% of the time by pinning one of the NFS daemons to port 993 by modifying /etc/sysconfig/nfs.)
dovecot starts normally.
A fix that works for me: use portreserve, i.e.
echo "993" > /etc/portreserve/imaps
Add to /etc/init.d/dovecot in the start() function:
[ -x /sbin/portrelease ] && /sbin/portrelease imaps &>/dev/null || :
This was already reported. Closing as duplicate.
Unfortunately, the original bug is private, so you won't be able to see it.
*** This bug has been marked as a duplicate of bug 723228 ***