Multi-thread cyrus delayed forking of imapd processes after connecting to master listener

Edda letters001 at sendmaid.org
Wed May 24 16:30:59 EDT 2017


Am 24.05.17 um 06:00 schrieb Michael Hieb:
[...]
>
>
> MAILSERVER:~ # strace -p 2120
> Process 2120 attached
> fcntl(13, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}
>
> Process hangs, nothing happening... then about 45 seconds later (in 
> this case - time to wait varies each time I try this) it frees itself 
> and strace shows this:
>
> MAILSERVER:~ # strace -p 2120
> Process 2120 attached
> fcntl(13, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
> stat("/usr/lib/cyrus/bin/imapd", {st_mode=S_IFREG|0755, 
> st_size=1758976, ...}) = 0
> accept(4, 0, NULL)                      = 14
> fcntl(13, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
>
It tries to acquire a write lock on a file and finally gets it when 
another process releases it. Seems to be the lock file itself.

With your configuration all different imapd processes use the same lock 
file because of their name "imap". Lock files are located in 
/var/lib/imap/socket, search for imap-0.lock and imap-1.lock.

As others already suggested:
- use a unique name for each line/process in the SERVICES section
- use only alphanumeric characters [a-z0-9]

This should work:

imap1 cmd="imapd -C /etc/imapd.domain1.com.conf " 
listen="192.168.171.4:imap" maxchild=-1 maxforkrate=100
imap2 cmd="imapd -C /etc/imapd.domain1.com.conf " 
listen="192.168.110.171:imap" maxchild=-1 maxforkrate=100
...

This doesn't work because of the dots:
imap.domain1.com.external                    cmd="imapd -C 
/etc/imapd.domain1.com.conf " listen="192.168.171.4:imap" maxchild=-1 
maxforkrate=100
imap.domain1.com.internal                    cmd="imapd -C 
/etc/imapd.domain1.com.conf " listen="192.168.110.171:imap" maxchild=-1 
maxforkrate=100
...

Check lock file names in /var/lib/imap/socket. You should see 
<name>-0.lock and/or <name>-1.lock files for every name.

Edda



More information about the Info-cyrus mailing list