From: Wouter Wijngaards Date: Thu, 17 Jul 2008 10:07:40 +0000 (+0000) Subject: fds max test before start. X-Git-Tag: release-1.0.2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ab18cb0f733c5338538972ecf834564bf8a4b81;p=thirdparty%2Funbound.git fds max test before start. git-svn-id: file:///svn/unbound/trunk@1156 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/unbound.c b/daemon/unbound.c index 2c2fcb5c1..f1732eaef 100644 --- a/daemon/unbound.c +++ b/daemon/unbound.c @@ -141,6 +141,21 @@ checkrlimits(struct config_file* cfg) log_warn("increased limit(open files) from %u to %u", (unsigned)avail, (unsigned)total+10); } + if(total > 1024 && + strncmp(event_get_version(), "mini-event", 10) == 0) { + log_err("too many file descriptors requested. The builtin" + "mini-event cannot handle more than 1024. Config " + "for less fds or compile with libevent"); + fatal_exit("configuration needs too many file descriptors"); + } + if(perthread > 64 && + strncmp(event_get_version(), "winsock-event", 13) == 0) { + log_err("too many file descriptors requested. The winsock" + " event handler cannot handle more than 64 per " + " thread. Config for less fds or compile with " + " libevent"); + fatal_exit("configuration needs too many file descriptors"); + } #else (void)cfg; #endif /* HAVE_GETRLIMIT */ diff --git a/doc/Changelog b/doc/Changelog index 7e8f15548..e5ea1a544 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,8 @@ 17 July 2008: Wouter - fix bug #196, compile outside source tree. - fix bug #195, add --with-username=user configure option. + - print error and exit if started with config that requires more + fds than the builtin minievent can handle. 16 July 2008: Wouter - made svn tag 1.0.1, trunk now 1.0.2