summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorjnemeth <jnemeth>2008-07-10 00:54:30 +0000
committerjnemeth <jnemeth>2008-07-10 00:54:30 +0000
commit7ab34c321727765da28c42bfd851cd85c72a154a (patch)
tree5d79f9f8f545cf06aad9981450055f11047a4486 /mail
parent82a8ae7a9d8d5ea52b374ae05c016b1ff73262c7 (diff)
downloadpkgsrc-7ab34c321727765da28c42bfd851cd85c72a154a.tar.gz
bump default file descriptor limit as it is too low on NetBSD
Diffstat (limited to 'mail')
-rw-r--r--mail/dovecot/Makefile3
-rwxr-xr-xmail/dovecot/files/dovecot.sh16
2 files changed, 17 insertions, 2 deletions
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"