From 12137ba67b81cdda6d765d2a1aefde96acb73ac6 Mon Sep 17 00:00:00 2001 From: jnemeth Date: Thu, 10 Jul 2008 00:54:30 +0000 Subject: bump default file descriptor limit as it is too low on NetBSD --- mail/dovecot/Makefile | 3 ++- mail/dovecot/files/dovecot.sh | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'mail') diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile index dc206b324e3..7894c6b13a9 100644 --- a/mail/dovecot/Makefile +++ b/mail/dovecot/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.117 2008/06/22 17:41:23 ghen Exp $ +# $NetBSD: Makefile,v 1.118 2008/07/10 00:54:30 jnemeth Exp $ DISTNAME= dovecot-1.1.1 +PKGREVISION= 1 CATEGORIES= mail MASTER_SITES= http://www.dovecot.org/releases/1.1/ diff --git a/mail/dovecot/files/dovecot.sh b/mail/dovecot/files/dovecot.sh index 0fdb7f8ad0a..8c80b85a931 100755 --- a/mail/dovecot/files/dovecot.sh +++ b/mail/dovecot/files/dovecot.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: dovecot.sh,v 1.3 2008/06/22 17:41:23 ghen Exp $ +# $NetBSD: dovecot.sh,v 1.4 2008/07/10 00:54:30 jnemeth Exp $ # # PROVIDE: dovecot @@ -14,5 +14,19 @@ command="@PREFIX@/sbin/${name}" required_files="@PKG_SYSCONFDIR@/$name.conf" extra_commands="reload" +dovecot_fdlimit=${dovecot_fdlimit-"768"} + +# A default limit of 64 (at least on NetBSD) may be too low for many people +SOFT_FDLIMIT=`ulimit -S -n` +HARD_FDLIMIT=`ulimit -H -n` + +if [ ${dovecot_fdlimit} -gt ${SOFT_FDLIMIT} ]; then + if [ ${dovecot_fdlimit} -le ${HARD_FDLIMIT} ]; then + ulimit -S -n ${dovecot_fdlimit} + else + ulimit -S -n ${HARD_FDLIMIT} + fi +fi + load_rc_config $name run_rc_command "$1" -- cgit v1.2.3