Bug 986045

Summary: dovecot imap sometimes fails to start because another service has taken the IMAPS port
Product: Red Hat Enterprise Linux 6 Reporter: Ben Webb <ben>
Component: dovecotAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-14 11:08:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Webb 2013-07-18 20:45:20 UTC
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):
dovecot-2.0.9-5.el6.x86_64

How reproducible:
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.

Actual results:
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
                                                           [FAILED]

(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.)


Expected results:
dovecot starts normally.


Additional info:
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 || :

Comment 1 Michal Hlavinka 2013-08-14 11:08:02 UTC
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 ***