dovecot won't start during boot

Bug #700741 reported by Leander Janssen
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dovecot (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Dovecot won't automatically start during boot.
In /var/log/mail.log the following messages are logged:

Jan 9 17:46:40 njord dovecot: bind(<ip address>, 993) failed: Cannot assign requested address
Jan 9 17:46:40 njord dovecot: Fatal: listen(<ip address>, 993) failed: Cannot assign requested address

I think this issue is related to the fact that I've specified specific interfaces on which dovecot should listen in /etc/dovecot/dovecot.conf:

protocol imap {
   listen = 94.142.x.x:143, 192.168.x.x:143
   ssl_listen = 94.142.x.x:993,[2a02:898:x::x:0]:993, 192.168.x.x:993
}

Revision history for this message
Leander Janssen (leanderjanssen) wrote :

Ubuntu release is Maverick
Dovecot version is 1:1.2.12-1ubuntu8

description: updated
Robert Roth (evfool)
affects: ubuntu → dovecot (Ubuntu)
Revision history for this message
Jussi Jaurola (jussi-jaurola) wrote :

Hi!

Can you upload your /etc/network/interfaces-file? It might be that network is not fully up before your dovecot starts, can you also run sudo find /etc/rc* -name '*networking*' and sudo find /etc/rc* -name '*dovecot*'

Revision history for this message
Leander Janssen (leanderjanssen) wrote :

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 94.142.x.x
        netmask 255.255.255.240
        network 94.142.x.0
        broadcast 94.142.x.x
        gateway 94.142.x.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 94.142.x.1
        dns-search slaco.net

iface eth0 inet6 static
        address 2a02:898:x::x:0
        netmask 64
        gateway 2a02:898:x::1

# The private network interface
auto eth1
iface eth1 inet static
        address 192.168.x.x
        netmask 255.255.255.0
        network 192.168.x.0
        broadcast 192.168.x.255

iface eth1 inet6 static
        address 2a02:898:x:ffff::x:0
        netmask 64

Revision history for this message
Leander Janssen (leanderjanssen) wrote :

sudo find /etc/rc* -name '*networking*'
/etc/rc0.d/S35networking
/etc/rc6.d/S35networking

sudo find /etc/rc* -name '*dovecot*'

no matches, as dovecot is started by upstart

Changed in dovecot (Ubuntu):
status: New → Incomplete
Revision history for this message
Jussi Jaurola (jussi-jaurola) wrote :

Hi,

Thank you. My mistake, I forgot that dovecot is moved to upstart, you could alter dovecots upstart-script (/etc/init/dovecot.conf) to be like;

start on (started rc-sysinit and net-device-up IFACE=eth0)

to ensure that network is up before upstart tries to start postfix-service. This is because it looks like now your server tries to start dovecot while network is still not up.

Revision history for this message
Leander Janssen (leanderjanssen) wrote :

I've tried your suggestion, but that doesn't seem to help.
Dovecot is not started during boot and I see the same "failed: Cannot assign requested address" messages in mail.log

I've pasted part of the /etc/init/dovecot.conf

# dovecot - pop3/imap mail server
#
# Dovecot is a mail server whose major goals are security and extreme reliabilit
y.

description "dovecot - pop3/imap mail server"

#start on started rc-sysinit
start on (started rc-sysinit and net-device-up IFACE=eth0)
stop on runlevel [!2345]

pre-start script
    test -x /usr/sbin/dovecot || { stop ; exit 0; }
    test -r /etc/dovecot/dovecot.conf || { stop ; exit 0; }

<snip>

Revision history for this message
Jussi Jaurola (jussi-jaurola) wrote :

Thank you. So Dovecot is starting if you start it manually, but not during boot?

Revision history for this message
Leander Janssen (leanderjanssen) wrote :

Yes, when I (re)start it after boot it starts successfully.

Chuck Short (zulcss)
Changed in dovecot (Ubuntu):
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

This bug was fixed in Oneiric by changing the boot sequence to not emit runlevel 2 until after all interfaces in /etc/network/interfaces are up.

Changed in dovecot (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
bamyasi (iadzhubey) wrote :

There was apparently a regression in Ubuntu 15.10 since I started experiencing exactly the same problem with dovecot server failing to start on system boot after upgrading my computer to release 15.10 (from 15.04):

$ sudo systemctl status dovecot.service
● dovecot.service - Dovecot IMAP/POP3 email server
   Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2015-11-09 12:15:21 EST; 4min 21s ago
  Process: 798 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
 Main PID: 798 (code=exited, status=89)

Nov 09 12:15:21 dovecot[798]: master: Error: service(imap-login): listen(192.168.1.100, 143) failed: Cannot assign...address
Nov 09 12:15:21 dovecot[798]: master: Error: bind(192.168.1.100, 993) failed: Cannot assign requested address
Nov 09 12:15:21 dovecot[798]: master: Error: service(imap-login): listen(192.168.1.100, 993) failed: Cannot assign...address
Nov 09 12:15:21 dovecot[798]: Error: service(imap-login): listen(192.168.1.100, 143) failed: Cannot assign requested address
Nov 09 12:15:21 dovecot[798]: Error: bind(192.168.1.100, 993) failed: Cannot assign requested address
Nov 09 12:15:21 dovecot[798]: Error: service(imap-login): listen(192.168.1.100, 993) failed: Cannot assign requested address
Nov 09 12:15:21 dovecot[798]: Fatal: Failed to start listeners
Nov 09 12:15:21 systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
Nov 09 12:15:21 systemd[1]: dovecot.service: Unit entered failed state.
Nov 09 12:15:21 systemd[1]: dovecot.service: Failed with result 'exit-code'.

The network interface is configured dynamically by the DHCP server on the router.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.