aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-04-25 16:06:15 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-04-25 16:08:57 +0000
commit6fb74a8e88799ae2fc8c3e96d776ef2901fb7a8e (patch)
treea1268770fc905a6aaadfb99a45303de1d3d0b436 /main
parent635fb0a54ab947adfaa4d7102e2e54680188385c (diff)
downloadaports-6fb74a8e88799ae2fc8c3e96d776ef2901fb7a8e.tar.bz2
aports-6fb74a8e88799ae2fc8c3e96d776ef2901fb7a8e.tar.xz
main/squid: disable hardcoded --max-filedescriptors
Use what ever is the system default (with ulimit) or let user configure in squid.conf ref #2850
Diffstat (limited to 'main')
-rw-r--r--main/squid/APKBUILD15
-rw-r--r--main/squid/squid.confd4
-rw-r--r--main/squid/squid.initd36
3 files changed, 19 insertions, 36 deletions
diff --git a/main/squid/APKBUILD b/main/squid/APKBUILD
index 96081f49d8..05a395ad7b 100644
--- a/main/squid/APKBUILD
+++ b/main/squid/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=squid
pkgver=3.3.11
-pkgrel=0
+pkgrel=1
pkgdesc="A full-featured Web proxy cache server."
url="http://www.squid-cache.org"
install="squid.pre-install squid.pre-upgrade"
@@ -78,7 +78,6 @@ build() {
--enable-htcp \
--enable-carp \
--enable-poll \
- --with-filedescriptors=16384 \
--enable-follow-x-forwarded-for \
--with-large-files \
--with-default-user=squid \
@@ -113,20 +112,20 @@ md5sums="abf2b0fe128f73f5dc157e7e917949e0 squid-3.3.11.tar.bz2
31b771f75d155f3d0bee76a246040894 squid-3.3.9-loggable-urlgroup.patch
473f8f6dabaec2bd73134d8288deea3d cf_gen-pthread.patch
9e71076799d334faba6f4954594e7b4a bug-3679.patch
-905e57c6d41414f54a75a5c0f9f7fac7 squid.initd
-2897c725c201be53d3c9a7db0101bdf0 squid.confd
+947b668332a205626c854d0aece0f3e0 squid.initd
+73db59e6c1c242dbc748feeb116650e0 squid.confd
58823e0b86bc2dc71d270208b7b284b4 squid.logrotate"
sha256sums="6b314cd706693522f01d5ab1930f3aa7a9b03a913bc0e699def16cca8d15ea54 squid-3.3.11.tar.bz2
0a4192ab1df22db309f35d4dcd80414bede84a591776ba7ef775e9e443663c1e squid-3.3.9-loggable-urlgroup.patch
3b05ebd2d4baeb0e01437de768c8fbe76ff446f126d107b73fad6bd0d1968f0c cf_gen-pthread.patch
6b08cd129ea5fef019c78f1818c628e1070fe767e362da14844396b671f5a18d bug-3679.patch
-3e5786304f218aecd5c01fa4b81aa05092ee3c7652d914b01112222fb5b2796e squid.initd
-ec2a9f3308129354783c5088fb37148eda102fe9397fb7bbe90243d9223ee2e1 squid.confd
+29eb267e6ebf9b409836b35ba37f263924f40c30cd0c24b91b1ddce380f2163b squid.initd
+4012fc97d7ab653c8a73c4dac09751de80c847a90ee2483ddd41a04168cdeb2b squid.confd
b6efdb3261c2e4b5074ef49160af8b96e65f934c7fd64b8954df48aa41cd9b67 squid.logrotate"
sha512sums="bb29681e323cd0e3ed19641850c5a1829ab4a80b935a15de259d02f0f753ab209acf5c8f2f1186c70a30b659c6ef48a1154c9b261a3ebc2f00189b74e48c11b4 squid-3.3.11.tar.bz2
80360600275cb1b9c484c41c169dedc841c92fa519e9f146bb66fdb947b2dc897a72d49509180f88c4d9fb373457c9117838599ad41e272ecb2972738e905b7f squid-3.3.9-loggable-urlgroup.patch
c5a230fe1f4dda8a3ab064f07c2b93a6f6e3ebdf290cb45da262300d06ac28aa4470a80c8f14db5c9ff4dcc478933d9882bef638a566fe8ad66aec1f96f80be3 cf_gen-pthread.patch
b477397f205ba207502a42aae674c85cad85eec831158ea0834361d98ef09a0f103d7a847e101bdd0ece73bbdda9b545960edd5385042bd593733810977e292a bug-3679.patch
-d16178aef007bafa976b89def4371fdd05f26c5ab558f6619bf6f6ca915fc783d2314d7d8e96032abfaf7b3f8c8b746031f78a6be1f66245d9303ff3a9feb605 squid.initd
-f13b3ab159fdc7cdcccfe10e494a84fa2d67c999820e166a8ad67523094088c147d3712b00e9cfd0d6b7e3c0cc9a4ad3ee7d7f7d42e11f5b5c4b5e4bf5016b31 squid.confd
+3da7673cde48aac9d7f45b0c0208c2608dd66b3fa70f897b83cb3d0a4f9ba88f3e3706cbab65eb811e77a52643d8616350c84ab599d8e617212f934cb44ffc99 squid.initd
+7292661de344e8a87d855c83afce49511685d2680effab3afab110e45144c0117935f3bf73ab893c9e6d43f7fb5ba013635e24f6da6daf0eeb895ef2e9b5baa9 squid.confd
89a703fa4f21b6c7c26e64a46fd52407e20f00c34146ade0bea0c4b63d050117c0f8e218f2256a1fbf6abb84f4ec9b0472c9a4092ff6e78f07c4f5a25d0892a5 squid.logrotate"
diff --git a/main/squid/squid.confd b/main/squid/squid.confd
index e523123d53..c80d1c154c 100644
--- a/main/squid/squid.confd
+++ b/main/squid/squid.confd
@@ -6,10 +6,6 @@
SQUID_OPTS="-YC"
-# Max. number of filedescriptors to use. You can increase this on a busy
-# cache to a maximum of (currently) 8192 filedescriptors. Default is 1024.
-SQUID_MAXFD=1024
-
# Kerberos keytab file to use. This is required if you enable kerberos authentication.
SQUID_KEYTAB=""
diff --git a/main/squid/squid.initd b/main/squid/squid.initd
index 488a45b527..6e096f5a9c 100644
--- a/main/squid/squid.initd
+++ b/main/squid/squid.initd
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 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.14 2011/10/23 18:45:39 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/files/squid.initd-r3,v 1.1 2013/01/11 15:25:49 eras Exp $
extra_started_commands="reload rotate"
@@ -11,25 +11,6 @@ depend() {
after firewall
}
-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
- [ $SQUID_MAXFD -le 8192 ] || SQUID_MAXFD=8192
- local minimal_file_max=$(($SQUID_MAXFD + 4096))
- 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
-}
-
checkconfig() {
if [ ! -f /etc/squid/${SVCNAME}.conf ]; then
eerror "You need to create /etc/squid/${SVCNAME}.conf first."
@@ -47,11 +28,18 @@ checkconfig() {
return 1
fi
- maxfds
+ # Maximum file descriptors squid can open is determined by:
+ # a basic default of N=1024
+ # ... altered by ./configure --with-filedescriptors=N
+ # ... overridden on production by squid.conf max_filedescriptors (if,
+ # and only if, setrlimit() RLIMIT_NOFILE is able to be built+used).
+ # Since we do not configure hard coded # of filedescriptors anymore,
+ # there is no need for ulimit calls in the init script.
+ # Use max_filedescriptors in squid.conf instead.
local CACHE_SWAP=$(awk '/^[ \t]*cache_dir[ \t]+/ { if ($2 == "coss" ) printf "%s/stripe ", $3 ; else printf "%s/00 ", $3; }' < /etc/squid/${SVCNAME}.conf)
[ -z "$CACHE_SWAP" ] && CACHE_SWAP="/var/cache/squid/00"
-
+
local x
for x in $CACHE_SWAP ; do
if [ ! -e $x ] ; then
@@ -77,7 +65,7 @@ checkconfig() {
break
fi
done
-
+
return 0
}