Bug#825562: dovecot-imapd: service fail to start at boot time

2017-06-24 Thread Markus Gschwendt
This is a problem after upgrading to 'stretch' which is the 'stable'
release now.

Dovecot starts before the network is up.

i used a modified fix from RH:
https://bugzilla.redhat.com/show_bug.cgi?id=1309946

What works for me in debian stretch:
create file /etc/systemd/system/dovecot.service

with the content
~~
.include /lib/systemd/system/dovecot.service

[Unit]
After=network-online.target
~~



Bug#825562: dovecot-imapd: service fail to start at boot time

2016-07-25 Thread pitamila

Hi,

Sorry for the late reponse, I'm on holidays, accessing remotely to the 
box it gives:


On 07/22/2016 09:05 AM, Apollon Oikonomopoulos wrote:

Control: tags -1 moreinfo

Hi,

On 21:55 Fri 27 May , zulu wrote:

Package: dovecot-imapd
Version: 1:2.2.24-1
Severity: normal

Dear Maintainer,

At machine startup, dovecot-imap fail telling:
May 27 21:37:51 cop21 dovecot[502]: Error: bind(192.168.0.36, 143) failed: 
Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: Error: service(imap-login): 
listen(192.168.0.36, 143) failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: Error: bind(192.168.0.36, 993) failed: 
Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: Error: service(imap-login): 
listen(192.168.0.36, 993) failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: Fatal: Failed to start listeners
May 27 21:37:51 cop21 dovecot[502]: master: Error: bind(192.168.0.36, 143) 
failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: master: Error: service(imap-login): 
listen(192.168.0.36, 143) failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: master: Error: bind(192.168.0.36, 993) 
failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: master: Error: service(imap-login): 
listen(192.168.0.36, 993) failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: master: Fatal: Failed to start listeners
May 27 21:37:51 cop21 systemd[1]: dovecot.service: Control process exited, 
code=exited status=89
May 27 21:37:51 cop21 systemd[1]: Failed to start Dovecot IMAP/POP3 email 
server.
May 27 21:37:51 cop21 systemd[1]: dovecot.service: Unit entered failed state.
May 27 21:37:51 cop21 systemd[1]: dovecot.service: Failed with result 
'exit-code'.

manually restarting the service after boot works
I suppose this is related to systemd not starting the network interface before 
starting
the dovecot-imap daemon?

Indeed, it looks like 192.168.0.36 has not been assigned (yet?) to the
interface. Do you use /etc/network/interfaces
here is my /etc/network/interfaces (I installed this box, a arm SOC 
wandboard with the debian-stretch

installer a few months ago)


# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

  or systemd-networkd for
interface configuration? Can you provide the contents of
/etc/network/interfaces or /etc/systemd/network/* respectively?

/etc/systemd/network/ is empty

  Also,
can you please provide the output of

  systemd-analyze dot dovecot.service network.target

$ systemd-analyze dot dovecot.service network.target
digraph systemd {
"nfs-server.service"->"network.target" [color="green"];
"nfs-server.service"->"network.target" [color="black"];
"networking.service"->"network.target" [color="grey66"];
"shutdown.target"->"dovecot.service" [color="green"];
"nmbd.service"->"network.target" [color="green"];
"network-online.target"->"network.target" [color="green"];
"mysql.service"->"network.target" [color="green"];
"multi-user.target"->"dovecot.service" [color="green"];
"multi-user.target"->"dovecot.service" [color="grey66"];
"rpc-statd.service"->"network.target" [color="green"];
"php5-fpm.service"->"network.target" [color="green"];
"rpc-statd-notify.service"->"network.target" [color="green"];
"ssh.service"->"network.target" [color="green"];
"syncserver.service"->"network.target" [color="green"];
"mpd.service"->"network.target" [color="green"];
"systemd-user-sessions.service"->"network.target" [color="green"];
"postfix.service"->"network.target" [color="green"];
"fail2ban.service"->"network.target" [color="green"];
"rc-local.service"->"network.target" [color="green"];
"nginx.service"->"network.target" [color="green"];
"smbd.service"->"network.target" [color="green"];
"dovecot.service"->"local-fs.target" [color="green"];
"dovecot.service"->"basic.target" [color="green"];
"dovecot.service"->"systemd-journald.socket" [color="green"];
"dovecot.service"->"system.slice" [color="green"];
"dovecot.service"->"-.mount" [color="green"];
"dovecot.service"->"network.target" [color="green"];
"dovecot.service"->"sysinit.target" [color="green"];
"dovecot.service"->"system.slice" [color="black"];
"dovecot.service"->"-.mount" [color="black"];
"dovecot.service"->"sysinit.target" [color="black"];
"dovecot.service"->"shutdown.target" [color="red"];
"network.target"->"ifup@eth0.service" [color="green"];
"network.target"->"networking.service" [color="green"];
"network.target"->"network-pre.target" [color="green"];
"network.target"->"shutdown.target" [color="red"];

Bug#825562: dovecot-imapd: service fail to start at boot time

2016-07-22 Thread Apollon Oikonomopoulos
Control: tags -1 moreinfo

Hi,

On 21:55 Fri 27 May , zulu wrote:
> Package: dovecot-imapd
> Version: 1:2.2.24-1
> Severity: normal
> 
> Dear Maintainer,
> 
> At machine startup, dovecot-imap fail telling:
> May 27 21:37:51 cop21 dovecot[502]: Error: bind(192.168.0.36, 143) failed: 
> Cannot assign requested address
> May 27 21:37:51 cop21 dovecot[502]: Error: service(imap-login): 
> listen(192.168.0.36, 143) failed: Cannot assign requested address
> May 27 21:37:51 cop21 dovecot[502]: Error: bind(192.168.0.36, 993) failed: 
> Cannot assign requested address
> May 27 21:37:51 cop21 dovecot[502]: Error: service(imap-login): 
> listen(192.168.0.36, 993) failed: Cannot assign requested address
> May 27 21:37:51 cop21 dovecot[502]: Fatal: Failed to start listeners
> May 27 21:37:51 cop21 dovecot[502]: master: Error: bind(192.168.0.36, 143) 
> failed: Cannot assign requested address
> May 27 21:37:51 cop21 dovecot[502]: master: Error: service(imap-login): 
> listen(192.168.0.36, 143) failed: Cannot assign requested address
> May 27 21:37:51 cop21 dovecot[502]: master: Error: bind(192.168.0.36, 993) 
> failed: Cannot assign requested address
> May 27 21:37:51 cop21 dovecot[502]: master: Error: service(imap-login): 
> listen(192.168.0.36, 993) failed: Cannot assign requested address
> May 27 21:37:51 cop21 dovecot[502]: master: Fatal: Failed to start listeners
> May 27 21:37:51 cop21 systemd[1]: dovecot.service: Control process exited, 
> code=exited status=89
> May 27 21:37:51 cop21 systemd[1]: Failed to start Dovecot IMAP/POP3 email 
> server.
> May 27 21:37:51 cop21 systemd[1]: dovecot.service: Unit entered failed state.
> May 27 21:37:51 cop21 systemd[1]: dovecot.service: Failed with result 
> 'exit-code'.
> 
> manually restarting the service after boot works
> I suppose this is related to systemd not starting the network interface 
> before starting
> the dovecot-imap daemon?

Indeed, it looks like 192.168.0.36 has not been assigned (yet?) to the 
interface. Do you use /etc/network/interfaces or systemd-networkd for 
interface configuration? Can you provide the contents of 
/etc/network/interfaces or /etc/systemd/network/* respectively? Also, 
can you please provide the output of

 systemd-analyze dot dovecot.service network.target

As a workaround you could either use non-local binds (echo 1 > 
/proc/sys/net/ipv4/ip_nonlocal_bind) or bind to the wildcard address 
(0.0.0.0) if that's okay with your setup.

Regards,
Apollon



Bug#825562: dovecot-imapd: service fail to start at boot time

2016-05-27 Thread zulu
Package: dovecot-imapd
Version: 1:2.2.24-1
Severity: normal

Dear Maintainer,

At machine startup, dovecot-imap fail telling:
May 27 21:37:51 cop21 dovecot[502]: Error: bind(192.168.0.36, 143) failed: 
Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: Error: service(imap-login): 
listen(192.168.0.36, 143) failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: Error: bind(192.168.0.36, 993) failed: 
Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: Error: service(imap-login): 
listen(192.168.0.36, 993) failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: Fatal: Failed to start listeners
May 27 21:37:51 cop21 dovecot[502]: master: Error: bind(192.168.0.36, 143) 
failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: master: Error: service(imap-login): 
listen(192.168.0.36, 143) failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: master: Error: bind(192.168.0.36, 993) 
failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: master: Error: service(imap-login): 
listen(192.168.0.36, 993) failed: Cannot assign requested address
May 27 21:37:51 cop21 dovecot[502]: master: Fatal: Failed to start listeners
May 27 21:37:51 cop21 systemd[1]: dovecot.service: Control process exited, 
code=exited status=89
May 27 21:37:51 cop21 systemd[1]: Failed to start Dovecot IMAP/POP3 email 
server.
May 27 21:37:51 cop21 systemd[1]: dovecot.service: Unit entered failed state.
May 27 21:37:51 cop21 systemd[1]: dovecot.service: Failed with result 
'exit-code'.

manually restarting the service after boot works
I suppose this is related to systemd not starting the network interface before 
starting
the dovecot-imap daemon?

-- Package-specific info:

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: armhf (armv7l)

Kernel: Linux 4.5.0-2-armmp (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dovecot-imapd depends on:
ii  dovecot-core  1:2.2.24-1
ii  libbz2-1.01.0.6-8
ii  libc6 2.22-9
ii  liblz4-1  0.0~r131-2
ii  liblzma5  5.1.1alpha+20120614-2.1
ii  ucf   3.0036
ii  zlib1g1:1.2.8.dfsg-2+b1

dovecot-imapd recommends no packages.

dovecot-imapd suggests no packages.

Versions of packages dovecot-imapd is related to:
ii  dovecot-core [dovecot-common]  1:2.2.24-1
pn  dovecot-dbg
pn  dovecot-dev
pn  dovecot-gssapi 
ii  dovecot-imapd  1:2.2.24-1
pn  dovecot-ldap   
pn  dovecot-lmtpd  
pn  dovecot-managesieved   
pn  dovecot-mysql  
pn  dovecot-pgsql  
pn  dovecot-pop3d  
pn  dovecot-sieve  
pn  dovecot-sqlite 

-- no debconf information