diff options
author | Alin Năstac <mrness@gentoo.org> | 2006-01-09 11:51:47 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2006-01-09 11:51:47 +0000 |
commit | 2fd29081cf7b9a464abc3e47d004b487e88a9000 (patch) | |
tree | 2414eb98891acfd04120556c4383d08da69a4af3 /net-proxy | |
parent | Version bump. (diff) | |
download | historical-2fd29081cf7b9a464abc3e47d004b487e88a9000.tar.gz historical-2fd29081cf7b9a464abc3e47d004b487e88a9000.tar.bz2 historical-2fd29081cf7b9a464abc3e47d004b487e88a9000.zip |
Add rotate functionality to init script (#118376).
Package-Manager: portage-2.0.53
Diffstat (limited to 'net-proxy')
-rw-r--r-- | net-proxy/squid/ChangeLog | 9 | ||||
-rw-r--r-- | net-proxy/squid/Manifest | 19 | ||||
-rw-r--r-- | net-proxy/squid/files/squid.initd | 11 | ||||
-rw-r--r-- | net-proxy/squid/files/squid.initd-logrotate | 82 | ||||
-rw-r--r-- | net-proxy/squid/files/squid.logrotate (renamed from net-proxy/squid/files/squid-logrotate) | 0 | ||||
-rw-r--r-- | net-proxy/squid/squid-2.5.11.ebuild | 7 | ||||
-rw-r--r-- | net-proxy/squid/squid-2.5.12.ebuild | 7 |
7 files changed, 114 insertions, 21 deletions
diff --git a/net-proxy/squid/ChangeLog b/net-proxy/squid/ChangeLog index 49207f32a808..54b1d924b039 100644 --- a/net-proxy/squid/ChangeLog +++ b/net-proxy/squid/ChangeLog @@ -1,11 +1,12 @@ # ChangeLog for net-proxy/squid # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/ChangeLog,v 1.59 2006/01/09 06:03:12 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/ChangeLog,v 1.60 2006/01/09 11:51:47 mrness Exp $ - 09 Jan 2006; Alin Nastac <mrness@gentoo.org> files/squid.pam, - -files/squid.pam-include, -squid-2.5.10-r2.ebuild, + 09 Jan 2006; Alin Nastac <mrness@gentoo.org> files/squid.initd, + files/squid.pam, -files/squid.pam-include, +files/squid.initd-logrotate, + +files/squid.logrotate, -files/squid-logrotate, -squid-2.5.10-r2.ebuild, -squid-2.5.10-r4.ebuild, squid-2.5.11.ebuild, squid-2.5.12.ebuild: - Remove old versions. + Remove old versions. Add rotate functionality to init script (#118376). 08 Jan 2006; Stuart Longland <redhatter@gentoo.org> squid-2.5.12.ebuild: Marked 2.5.12 stable on MIPS, and fixed the copyright header to keep repoman diff --git a/net-proxy/squid/Manifest b/net-proxy/squid/Manifest index e6753e311388..773437610707 100644 --- a/net-proxy/squid/Manifest +++ b/net-proxy/squid/Manifest @@ -1,21 +1,22 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -MD5 4e50bfd290bb229df1d7ac43767610cd ChangeLog 24554 +MD5 d3a651180ad99bc7865e0231ca54ec21 ChangeLog 24705 MD5 9aae33d4872e127be17e8a1bc587c2a7 files/digest-squid-2.5.11 157 MD5 3e02deef24558936110d58663433ace3 files/digest-squid-2.5.12 157 -MD5 5286e7e73ca5687381fa09ff41dccbd1 files/squid-logrotate 101 MD5 8e7207b10699502e573d9d60ff0e07a6 files/squid.confd 437 MD5 6f30a7f5c48ec35a7044acb189c858c5 files/squid.cron 133 -MD5 42a85d7b767f56a149bbf9e418f56375 files/squid.initd 2498 +MD5 33e02a9bf2162ee1f2910684916bb19a files/squid.initd 2642 +MD5 b913d146f7966abe8392138accc29e69 files/squid.initd-logrotate 2508 +MD5 5286e7e73ca5687381fa09ff41dccbd1 files/squid.logrotate 101 MD5 2957ca0ec8bf84e4af8ed5adef7acb90 files/squid.pam 315 MD5 cf398556bce540358644ce9a452abfba metadata.xml 241 -MD5 e8f4e654ff81f19dc847611cfc40e68e squid-2.5.11.ebuild 6335 -MD5 c0b508f9566918f6cf08690035a05a81 squid-2.5.12.ebuild 6360 +MD5 e134f5c38aadc2fd333ac8b006dbc252 squid-2.5.11.ebuild 6389 +MD5 31e9c5b0a022091d02569297aec7e5e4 squid-2.5.12.ebuild 6414 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.2 (GNU/Linux) +Version: GnuPG v1.4.1 (GNU/Linux) -iD8DBQFDwfywjG8pv1lIUX4RAumaAKC4qexvTMVNC+atpSl5rxHY2jy7xwCggi5L -51l4nacB3swjeAa4rr3Ir64= -=BIAe +iD8DBQFDwk5hjG8pv1lIUX4RAnfWAJ9UL2lPC1wMw7ecdOBoyloRIltgygCguY+T +W2Zl8oBxkKrU9VbsSSf8Aw4= +=+MyL -----END PGP SIGNATURE----- diff --git a/net-proxy/squid/files/squid.initd b/net-proxy/squid/files/squid.initd index 950f1bf9fe84..01f4b06c9677 100644 --- a/net-proxy/squid/files/squid.initd +++ b/net-proxy/squid/files/squid.initd @@ -1,9 +1,9 @@ #!/sbin/runscript # Copyright 1999-2004 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.2 2005/12/31 10:20:17 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/files/squid.initd,v 1.3 2006/01/09 11:51:47 mrness Exp $ -opts="${opts} reload" +opts="${opts} reload rotate" depend() { need net @@ -80,3 +80,10 @@ reload() { /usr/sbin/squid -k reconfigure eend $? } + +rotate() { + service_started squid || return 1 + ebegin "Rotating logs" + /usr/sbin/squid -k rotate + eend $? +} diff --git a/net-proxy/squid/files/squid.initd-logrotate b/net-proxy/squid/files/squid.initd-logrotate new file mode 100644 index 000000000000..b43bd3dcf069 --- /dev/null +++ b/net-proxy/squid/files/squid.initd-logrotate @@ -0,0 +1,82 @@ +#!/sbin/runscript +# Copyright 1999-2004 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.1 2006/01/09 11:51:47 mrness Exp $ + +opts="${opts} reload" + +depend() { + need net +} + +# 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 + global_file_max=`cat /proc/sys/fs/file-max` + minimal_file_max=$(($SQUID_MAXFD + 4096)) + if [ "$global_file_max" -lt $minimal_file_max ] + then + echo $minimal_file_max > /proc/sys/fs/file-max + fi + ulimit -n $SQUID_MAXFD +} + +checkconfig() { + maxfds + CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid/squid.conf | \ + grep cache_dir | awk '{ print $3 }'` + [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/cache/squid + umask 027 + for x in $CACHE_SWAP ; do + if [ ! -d $x/00 ] ; then + einfo "Initializing cache directory: $x" + cd $x + /usr/sbin/squid -z -F 2>/dev/null + if [ $? -ne 0 ] ; then + eerror "Error initializing: $x" + return 1 + fi + fi + done +} + +start() { + checkconfig || return 1 + ebegin "Starting squid" + /usr/sbin/squid ${SQUID_OPTS} + eend $? && sleep 1 +} + +stop() { + ebegin "Stopping squid" + /usr/sbin/squid -k shutdown + # Now we have to wait until squid has _really_ stopped. + sleep 1 + if [ -f /var/run/squid.pid ] ; then + einfon "Waiting ." + cnt=0 + while [ -f /var/run/squid.pid ] ; do + cnt=`expr $cnt + 1` + if [ $cnt -gt 60 ] ; then + # Waited 120 seconds now. Fail. + eend 1 "Failed." + break + fi + sleep 2 + echo -n "." + done + echo -n "done." + eend 0 + else + eend 0 + fi +} + +reload() { + checkconfig || return 1 + ebegin "Reloading squid" + /usr/sbin/squid -k reconfigure + eend $? +} diff --git a/net-proxy/squid/files/squid-logrotate b/net-proxy/squid/files/squid.logrotate index 72486b016fbf..72486b016fbf 100644 --- a/net-proxy/squid/files/squid-logrotate +++ b/net-proxy/squid/files/squid.logrotate diff --git a/net-proxy/squid/squid-2.5.11.ebuild b/net-proxy/squid/squid-2.5.11.ebuild index d725d4790a09..b381adedef03 100644 --- a/net-proxy/squid/squid-2.5.11.ebuild +++ b/net-proxy/squid/squid-2.5.11.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/squid-2.5.11.ebuild,v 1.8 2006/01/09 06:03:12 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/squid-2.5.11.ebuild,v 1.9 2006/01/09 11:51:47 mrness Exp $ inherit eutils pam toolchain-funcs @@ -172,12 +172,13 @@ src_install() { dodoc helpers/basic_auth/SASL/squid_sasl_auth* newpamd "${FILESDIR}/squid.pam" squid - newinitd "${FILESDIR}/squid.initd" squid newconfd "${FILESDIR}/squid.confd" squid if use logrotate; then + newinitd "${FILESDIR}/squid.initd-logrotate" squid insinto /etc/logrotate.d - newins "${FILESDIR}/squid-logrotate" squid + newins "${FILESDIR}/squid.logrotate" squid else + newinitd "${FILESDIR}/squid.initd" squid exeinto /etc/cron.weekly newexe "${FILESDIR}/squid.cron" squid.cron fi diff --git a/net-proxy/squid/squid-2.5.12.ebuild b/net-proxy/squid/squid-2.5.12.ebuild index 431d3337b8d6..e420c06c75e1 100644 --- a/net-proxy/squid/squid-2.5.12.ebuild +++ b/net-proxy/squid/squid-2.5.12.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/squid-2.5.12.ebuild,v 1.8 2006/01/09 06:03:12 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/squid-2.5.12.ebuild,v 1.9 2006/01/09 11:51:47 mrness Exp $ inherit eutils pam toolchain-funcs flag-o-matic @@ -172,12 +172,13 @@ src_install() { dodoc helpers/basic_auth/SASL/squid_sasl_auth* newpamd "${FILESDIR}/squid.pam" squid - newinitd "${FILESDIR}/squid.initd" squid newconfd "${FILESDIR}/squid.confd" squid if use logrotate; then + newinitd "${FILESDIR}/squid.initd-logrotate" squid insinto /etc/logrotate.d - newins "${FILESDIR}/squid-logrotate" squid + newins "${FILESDIR}/squid.logrotate" squid else + newinitd "${FILESDIR}/squid.initd" squid exeinto /etc/cron.weekly newexe "${FILESDIR}/squid.cron" squid.cron fi |