squid init v3.1: Bugfix release
Message ID | 1463408471-1292-1-git-send-email-matthias.fischer@ipfire.org |
---|---|
State | Superseded |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (hedwig.ipfire.org [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id E872760748 for <patchwork@ipfire.org>; Mon, 16 May 2016 16:21:24 +0200 (CEST) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 74227ABE; Mon, 16 May 2016 16:21:23 +0200 (CEST) Received: from Devel.localdomain (p5DD83ABE.dip0.t-ipconnect.de [93.216.58.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id BD584C2 for <development@lists.ipfire.org>; Mon, 16 May 2016 16:21:16 +0200 (CEST) From: Matthias Fischer <matthias.fischer@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH] squid init v3.1: Bugfix release Date: Mon, 16 May 2016 16:21:11 +0200 Message-Id: <1463408471-1292-1-git-send-email-matthias.fischer@ipfire.org> X-Mailer: git-send-email 2.8.2 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Message
Matthias Fischer
May 17, 2016, 12:21 a.m. UTC
- Fixed and adjusted non-working 'while'-loop for stopping still running
'(squid-1)'-processes.
- Commented 'wait' after 'killproc ...'-block: until now, no troubles found.
- Cosmetic tuning.
Best,
Matthias
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
---
src/initscripts/init.d/squid | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
Comments
Don't comment anything out. Either we need a line or we don't. On Mon, 2016-05-16 at 16:21 +0200, Matthias Fischer wrote: > - Fixed and adjusted non-working 'while'-loop for stopping still running > '(squid-1)'-processes. > > - Commented 'wait' after 'killproc ...'-block: until now, no troubles found. > > - Cosmetic tuning. > > Best, > Matthias > > Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org> > --- > src/initscripts/init.d/squid | 21 ++++++++++++++------- > 1 file changed, 14 insertions(+), 7 deletions(-) > > diff --git a/src/initscripts/init.d/squid b/src/initscripts/init.d/squid > index 47bf182..e5c9b85 100644 > --- a/src/initscripts/init.d/squid > +++ b/src/initscripts/init.d/squid > @@ -95,9 +95,9 @@ case "$1" in > iptables -t nat -F SQUID > if [ -e /var/run/squid.pid ]; then > boot_mesg -n "Shutting down Squid Proxy Server...\n" > - boot_mesg "(this may take up to a few minutes)." > + boot_mesg "(this may take up to a few minutes)" > /usr/sbin/squid -k shutdown >/dev/null 2>&1 > - evaluate_retval > +# evaluate_retval > > # Stop squidGuard, updxlrator, squidclamav > # and redirect_wrappers. > @@ -107,31 +107,38 @@ case "$1" in > killproc /usr/sbin/redirect_wrapper >/dev/null & > > # Wait until all redirectors have been stopped. > - wait > +# wait > > # If some squid processes are still running, wait up > to 360 seconds > # before we go on to kill all and delete entire cache > structure. > + > n=0 > - while [ /usr/sbin/squid -k check > /dev/null 2>&1 ] > && [ $n -lt 360 ]; do > - sleep 1 > - n=$(( ${n} + 1 )) > + while /usr/sbin/squid -k check > /dev/null 2>&1 && [ > $n -lt 360 ]; do > + sleep 2 > + n=$(( ${n} + 2 )) > + echo -n . > done > + echo "" > + echo "Done." > + echo "Shutdown time:" "$n" "seconds" > > # If (squid-1) is still running after 360 seconds, > # kill all squid processes and delete damaged cache > structure. > if ( pgrep -fl "(squid-1)" > /dev/null 2>&1 ); then > killproc /usr/sbin/squid >/dev/null > rm -rf /var/log/cache/* > + echo "" > boot_mesg -n "You should not be reading this > warning.\n" > boot_mesg -n "Some squid-processes had to be > killed after 360 seconds,\n" > boot_mesg -n "so index file and cache > contents had to be deleted.\n" > boot_mesg -n "Therefore, the complete cache > structure will be rebuild\n" > boot_mesg "during next start." > echo_warning > + echo "" > else > boot_mesg "All squid processes exited > normally." > echo_ok > - boot_mesg "" > + echo "" > fi > fi >