IMAPD-2.2 imapd: Too many open files

Mike O'Rourke mike.orourke at op.org
Sun Feb 23 17:40:32 EST 2003


Hi All,

I compiled and installed the 2.2 branch on my Alpha Server (SuSE Linux 
7.1). When I start cyradm, imtest, or telnet to the imap port, the log gets 
these entries:
Feb 23 18:08:36 laudare master[18187]: about to exec /usr/cyrus/bin/imapd
Feb 23 18:08:36 laudare master[18187]: couldn't exec /usr/cyrus/bin/imapd: 
Too many open files
Feb 23 18:08:36 laudare master[18178]: unrecognized message for service 
'imap':1ffff5d0

I was able to catch this with strace (I never know how much of these to 
include, so here is all of it):

close(6)                                = 0
setuid(96)                                = 0
dup2(9, 3)                              = 3
dup2(7, 4)                              = 4
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, 0)                    = 0
fcntl(4, F_GETFD)                                = 0
fcntl(3, F_SETFD, 0)                               = 0
close(7)                               = 0
close(8)                               = 0
close(9)                               = 0
close(10)                               = 0
close(11)                               = 0
close(12) = 0
close(13)                          = 0
close(14)                               = 0
close(15) = 0
setrlimit(RLIMIT_NOFILE, {rlim_cur=0, rlim_max=0}) = 0
gettimeofday({1046012551, 826501}, NULL) = 0
getxpid() = 10728
rt_sigaction(SIGPIPE, {0x2000043b430, [], 0}, {SIG_DFL}, 8, 0) = 0
send(5, "<183>Feb 23 16:02:31 master[1072"..., 70, 0) = 70
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8, 0) = 0
send(5, "<183>Feb 23 16:02:31 master[1072"..., 70, 0) = 70
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8, 0) = 0
execve("/usr/cyrus/bin/imapd", ["imapd"], [/* 51 vars */]) = -1 EMFILE (Too 
many open files)
gettimeofday({1046012551, 832044}, NULL) = 0
getxpid() = 10728
rt_sigaction(SIGPIPE, {0x2000043b430, [], 0}, {SIG_DFL}, 8, 0) = 0
send(5, "<179>Feb 23 16:02:31 master[1072"..., 91, 0) = 91
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8, 0) = 0
write(3, "\207\342X>", 4) = 4
exit(71)                                = ?

The "setrlimit(RLIMIT_NOFILE, {rlim_cur=0, rlim_max=0}) = 0" seemed a 
little low to me, so I went to line 622 of master.c and changed "s->maxfds" 
to a hard 256 and the error went bye-bye. The server seems to be 
functioning normally now; although it is a test machine and not at all 
heavily loaded, except for some complaints about a DBERROR listing log 
files (they simply don't exist and cyrus seems not to want to create them 
-- this is a new install).





More information about the Info-cyrus mailing list