summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorsborrill <sborrill@pkgsrc.org>2015-10-08 10:07:10 +0000
committersborrill <sborrill@pkgsrc.org>2015-10-08 10:07:10 +0000
commitb2bdda0b49e14a1119fa646b692317739519fa3c (patch)
treed9c663ad99dad4476caabdba7eefb3142a2ba0c1 /www
parent5857d0ecb95a1cc12fb76116381f8c777e15cfb2 (diff)
downloadpkgsrc-b2bdda0b49e14a1119fa646b692317739519fa3c.tar.gz
Check current file descriptor limit and raise if required rather than
blindly setting to 4096 (which may in fact be lower than current limit). Bump PKGREVISION
Diffstat (limited to 'www')
-rw-r--r--www/squid3/Makefile3
-rw-r--r--www/squid3/files/squid.sh14
2 files changed, 14 insertions, 3 deletions
diff --git a/www/squid3/Makefile b/www/squid3/Makefile
index d85744ba302..3a30e9c22d5 100644
--- a/www/squid3/Makefile
+++ b/www/squid3/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.54 2015/10/02 07:57:13 adam Exp $
+# $NetBSD: Makefile,v 1.55 2015/10/08 10:07:10 sborrill Exp $
DISTNAME= squid-3.5.10
+PKGREVISION= 1
CATEGORIES= www
MASTER_SITES= http://www.squid-cache.org/Versions/v3/${PKGVERSION_NOREV:R}/ \
ftp://ftp.squid-cache.org/pub/squid/ \
diff --git a/www/squid3/files/squid.sh b/www/squid3/files/squid.sh
index e3d5ff7d0c5..34711fafc6e 100644
--- a/www/squid3/files/squid.sh
+++ b/www/squid3/files/squid.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: squid.sh,v 1.2 2014/08/29 11:13:46 tron Exp $
+# $NetBSD: squid.sh,v 1.3 2015/10/08 10:07:10 sborrill Exp $
#
# PROVIDE: squid
# REQUIRE: DAEMON
@@ -20,7 +20,17 @@ procname="squid-1"
required_files="${squid_conf} @PKG_SYSCONFDIR@/mime.conf"
command_args="-Y -f ${squid_conf}"
-start_precmd='ulimit -n 4096'
+start_precmd='setproclimits'
+
+setproclimits()
+{
+ local climit
+ climit=`ulimit -n`
+ if [ "$climit" -lt 4096 ]; then
+ ulimit -n 4096
+ fi
+}
+
# Note: 'shutdown' waits 30 seconds, while 'interrupt' stops immediately
reload_cmd="${command} ${squid_flags} ${command_args} -k reconfigure"
rotate_cmd="${command} ${squid_flags} ${command_args} -k rotate"