diff options
author | Alin Năstac <mrness@gentoo.org> | 2009-08-16 11:01:46 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2009-08-16 11:01:46 +0000 |
commit | 2f6a454773e357cae8fd9f22a65653361a2fe5a2 (patch) | |
tree | feb0de75afd6f6a68c6f2bf641f314c4a5e5f925 /net-proxy/squid/files | |
parent | Remove unused patches (diff) | |
download | gentoo-2-2f6a454773e357cae8fd9f22a65653361a2fe5a2.tar.gz gentoo-2-2f6a454773e357cae8fd9f22a65653361a2fe5a2.tar.bz2 gentoo-2-2f6a454773e357cae8fd9f22a65653361a2fe5a2.zip |
Enable epoll USE flag by default and increase max_user_watches to SQUID_MAXFD when squid is built with epoll support (#280666).
(Portage version: 2.1.6.13/cvs/Linux x86_64)
Diffstat (limited to 'net-proxy/squid/files')
-rw-r--r-- | net-proxy/squid/files/squid.initd | 16 | ||||
-rw-r--r-- | net-proxy/squid/files/squid.initd-logrotate | 16 |
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 } |