summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2008-04-13 13:33:13 +0000
committerAlin Năstac <mrness@gentoo.org>2008-04-13 13:33:13 +0000
commit890023bcf55060d7c39692374d6da9820e6fe5d1 (patch)
tree351e630b59684d40c1ba2a2799ca482c309a4f5b /net-proxy/squid
parentx86 stable, bug #210127 (diff)
downloadgentoo-2-890023bcf55060d7c39692374d6da9820e6fe5d1.tar.gz
gentoo-2-890023bcf55060d7c39692374d6da9820e6fe5d1.tar.bz2
gentoo-2-890023bcf55060d7c39692374d6da9820e6fe5d1.zip
Fix init script auto-initialization code for coss cache type (#217455).
(Portage version: 2.1.4.4)
Diffstat (limited to 'net-proxy/squid')
-rw-r--r--net-proxy/squid/ChangeLog6
-rw-r--r--net-proxy/squid/files/squid.initd17
-rw-r--r--net-proxy/squid/files/squid.initd-logrotate17
3 files changed, 29 insertions, 11 deletions
diff --git a/net-proxy/squid/ChangeLog b/net-proxy/squid/ChangeLog
index c810756fc3c4..24114d6b8823 100644
--- a/net-proxy/squid/ChangeLog
+++ b/net-proxy/squid/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-proxy/squid
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/ChangeLog,v 1.180 2008/04/12 17:53:16 dertobi123 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/ChangeLog,v 1.181 2008/04/13 13:33:12 mrness Exp $
+
+ 13 Apr 2008; Alin Năstac <mrness@gentoo.org> files/squid.initd,
+ files/squid.initd-logrotate:
+ Fix init script auto-initialization code for coss cache type (#217455).
12 Apr 2008; Tobias Scherbaum <dertobi123@gentoo.org> squid-2.6.18.ebuild:
ppc stable, bug #216319
diff --git a/net-proxy/squid/files/squid.initd b/net-proxy/squid/files/squid.initd
index 6e798c5915d1..9ef9eefe1319 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.7 2007/03/10 09:39:42 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/files/squid.initd,v 1.8 2008/04/13 13:33:13 mrness Exp $
opts="${opts} reload rotate"
@@ -24,22 +24,29 @@ maxfds() {
checkconfig() {
maxfds
- local CACHE_SWAP=$(awk '/^[ \t]*cache_dir[ \t]+/ { printf "%s ", $3 ; }' < /etc/squid/squid.conf)
- [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/cache/squid
- umask 027
+
+ local CACHE_SWAP=$(awk '/^[ \t]*cache_dir[ \t]+/ { if ($2 == "coss" ) printf "%s/stripe ", $3 ; else printf "%s/00 "; }' < /etc/squid/squid.conf)
+ [ -z "$CACHE_SWAP" ] && CACHE_SWAP="/var/cache/squid/00"
+
+ local x
for x in $CACHE_SWAP ; do
- if [ ! -d $x/00 ] ; then
+ if [ ! -e $x ] ; then
ebegin "Initializing cache directories"
+ local ORIG_UMASK=$(umask)
+ umask 027
local INIT_CACHE_RESPONSE="$(/usr/sbin/squid -z -N -D 2>&1)"
if [ $? != 0 ] || echo "$INIT_CACHE_RESPONSE" | grep -q "erminated abnormally" ; then
+ umask $ORIG_UMASK
eend 1
echo "$INIT_CACHE_RESPONSE"
return 1
fi
+ umask $ORIG_UMASK
eend 0
break
fi
done
+
return 0
}
diff --git a/net-proxy/squid/files/squid.initd-logrotate b/net-proxy/squid/files/squid.initd-logrotate
index 7f684bcec0ac..71b6f40876b8 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.5 2007/03/10 09:39:42 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/files/squid.initd-logrotate,v 1.6 2008/04/13 13:33:13 mrness Exp $
opts="${opts} reload"
@@ -24,22 +24,29 @@ maxfds() {
checkconfig() {
maxfds
- local CACHE_SWAP=$(awk '/^[ \t]*cache_dir[ \t]+/ { printf "%s ", $3 ; }' < /etc/squid/squid.conf)
- [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/cache/squid
- umask 027
+
+ local CACHE_SWAP=$(awk '/^[ \t]*cache_dir[ \t]+/ { if ($2 == "coss" ) printf "%s/stripe ", $3 ; else printf "%s/00 "; }' < /etc/squid/squid.conf)
+ [ -z "$CACHE_SWAP" ] && CACHE_SWAP="/var/cache/squid/00"
+
+ local x
for x in $CACHE_SWAP ; do
- if [ ! -d $x/00 ] ; then
+ if [ ! -e $x ] ; then
ebegin "Initializing cache directories"
+ local ORIG_UMASK=$(umask)
+ umask 027
local INIT_CACHE_RESPONSE="$(/usr/sbin/squid -z -N -D 2>&1)"
if [ $? != 0 ] || echo "$INIT_CACHE_RESPONSE" | grep -q "erminated abnormally" ; then
+ umask $ORIG_UMASK
eend 1
echo "$INIT_CACHE_RESPONSE"
return 1
fi
+ umask $ORIG_UMASK
eend 0
break
fi
done
+
return 0
}