summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2009-08-16 11:01:46 +0000
committerAlin Năstac <mrness@gentoo.org>2009-08-16 11:01:46 +0000
commit8b9794716679d6eb6a3e59975f5fc8000d590c1f (patch)
treef7be66239a8a744026901fe63d1c16ea2752ef92 /net-proxy/squid/files
parentRemove unused patches (diff)
downloadhistorical-8b9794716679d6eb6a3e59975f5fc8000d590c1f.tar.gz
historical-8b9794716679d6eb6a3e59975f5fc8000d590c1f.tar.bz2
historical-8b9794716679d6eb6a3e59975f5fc8000d590c1f.zip
Enable epoll USE flag by default and increase max_user_watches to SQUID_MAXFD when squid is built with epoll support (#280666).
Package-Manager: portage-2.1.6.13/cvs/Linux x86_64
Diffstat (limited to 'net-proxy/squid/files')
-rw-r--r--net-proxy/squid/files/squid.initd16
-rw-r--r--net-proxy/squid/files/squid.initd-logrotate16
2 files changed, 22 insertions, 10 deletions
diff --git a/net-proxy/squid/files/squid.initd b/net-proxy/squid/files/squid.initd
index 2c6b36f9f21a..be047c53b554 100644
--- a/net-proxy/squid/files/squid.initd
+++ b/net-proxy/squid/files/squid.initd
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/files/squid.initd,v 1.10 2008/11/30 19:20:44 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/files/squid.initd,v 1.11 2009/08/16 11:01:46 mrness Exp $
opts="${opts} reload rotate"
@@ -9,15 +9,21 @@ depend() {
need net
}
+upprocval() {
+ [ -f $1 ] || return 0
+ if [ `cat $1` -lt $2 ]; then
+ echo $2 > $1
+ fi
+}
+
# Try to increase the # of filedescriptors we can open.
maxfds() {
[ -n "$SQUID_MAXFD" ] || return
- [ -f /proc/sys/fs/file-max ] || return 0
[ $SQUID_MAXFD -le 8192 ] || SQUID_MAXFD=8192
- local global_file_max=`cat /proc/sys/fs/file-max`
local minimal_file_max=$(($SQUID_MAXFD + 4096))
- if [ "$global_file_max" -lt $minimal_file_max ]; then
- echo $minimal_file_max > /proc/sys/fs/file-max
+ upprocval /proc/sys/fs/file-max $minimal_file_max
+ if /usr/sbin/squid -v | grep -q "\--enable-epoll" ; then
+ upprocval /proc/sys/fs/epoll/max_user_watches $minimal_file_max
fi
ulimit -n $SQUID_MAXFD
}
diff --git a/net-proxy/squid/files/squid.initd-logrotate b/net-proxy/squid/files/squid.initd-logrotate
index 6c3e719e85f1..3a802bfec348 100644
--- a/net-proxy/squid/files/squid.initd-logrotate
+++ b/net-proxy/squid/files/squid.initd-logrotate
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/files/squid.initd-logrotate,v 1.8 2008/11/30 19:20:44 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/files/squid.initd-logrotate,v 1.9 2009/08/16 11:01:46 mrness Exp $
opts="${opts} reload"
@@ -9,15 +9,21 @@ depend() {
need net
}
+upprocval() {
+ [ -f $1 ] || return 0
+ if [ `cat $1` -lt $2 ]; then
+ echo $2 > $1
+ fi
+}
+
# Try to increase the # of filedescriptors we can open.
maxfds() {
[ -n "$SQUID_MAXFD" ] || return
- [ -f /proc/sys/fs/file-max ] || return 0
[ $SQUID_MAXFD -le 8192 ] || SQUID_MAXFD=8192
- local global_file_max=`cat /proc/sys/fs/file-max`
local minimal_file_max=$(($SQUID_MAXFD + 4096))
- if [ "$global_file_max" -lt $minimal_file_max ]; then
- echo $minimal_file_max > /proc/sys/fs/file-max
+ upprocval /proc/sys/fs/file-max $minimal_file_max
+ if /usr/sbin/squid -v | grep -q "\--enable-epoll" ; then
+ upprocval /proc/sys/fs/epoll/max_user_watches $minimal_file_max
fi
ulimit -n $SQUID_MAXFD
}