Re: Cyrus-imapd fails to bind on reboot when assigned to listen on specific IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/20/21 6:09 AM, simon@xxxxxxxxxxxxxxxx wrote:
When I don't specify an IP address, cyrus-imapd starts correctly on a server reboot.

When I specify IP / protocol:

   imap   cmd="imapd"   listen="192.168.1.230:imap"  prefork=5  proto=tcp4

cyrus-imapd tries to bind to those before it is available, and fails:

Mar 20 20:53:31 emp87 cyrus/master[973]: unable to bind to imap/ipv4 socket: Cannot assign requested address
Mar 20 20:53:31 emp87 cyrus/master[973]: unable to create imap listener socket: Cannot assign requested address

Restarting the service and all is good.

I can put After=network-online.target in the service description, but seems odd that I have to... any other suggestions?


You've got the correct answer right there; "After=network-online.target".  When you don't specify a bind address, cyrus uses 0.0.0.0, initially getting just 127.0.0.1.  As any new interfaces come online, it will bind to them.  But if you give it a specific IP, and that IP isn't available, cyrus exits.  Had you also given it 127.0.0.1, that might have worked, but I've not tried it.

FWIW, my Debian-based service  unit has this: After=local-fs.target network.target
which seems correct to me.

Cheers,
    -nic
-- 
Nic Bernstein                               nic@xxxxxxxxxxxxxxxx
https://www.nicbernstein.com
https://www.linkedin.com/in/nic-b-26577a178/

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux