Re: Stopping SQUID

From: Tilman Schmidt <Tilman.Schmidt@dont-contact.us>
Date: Mon, 13 Mar 2000 08:58:26 +0100

At 09:00 13.03.00 +1100, Simon Bryan wrote:
>[...] we have found that a simple 'shutdown
>now' hangs when trying to kill SQUID. I have found that I have to use -n (and -
>h to stop the reboot) to get it to go down.
>We are running Mandrake 6 and Squid2.2 Stable4.
>Does this sound like a Squid problem or a Linux problem? (or even normal
>behaviour?)

What are you using as your start/stop script? My Squid 2.2STABLE4 on a
SuSE Linux and it comes down just fine on regular shutdown, however I
am using a /sbin/init.d/squid script I wrote myself:

#!/bin/sh
#
# Start/stop Squid HTTP proxy server.
#

. /etc/rc.config
test "$START_SQUID" = yes || exit 0

case "$1" in

'start')
         if [ -x /usr/local/squid/bin/squid ]; then
                 echo "Starting Squid HTTP proxy/cache."
                 /usr/local/squid/bin/squid || exit 1
         fi
         ;;

'stop')
         echo "Shutting down Squid HTTP proxy/cache."
         /usr/local/squid/bin/squid -k shutdown

         countdown=60
         while /usr/local/squid/bin/squid -k check 2> /dev/null && [ $countdown -
gt 0 ]
         do
                 echo -ne "Waiting $countdown seconds for squid process to termin
ate...\r"
                 sleep 1
                 countdown=`expr $countdown - 1`
         done
         if [ $countdown -gt 0 ]
         then
                 echo -e "\nSquid terminated."
         else
                 echo -e "\nGiving up."
         fi
         ;;

'reload')
         echo "Reconfiguring Squid HTTP proxy/cache."
         /usr/local/squid/bin/squid -k reconfigure
         ;;

*)
         echo "Usage: $0 { start | stop | reload }"
         exit 1
         ;;

esac
exit 0

-- 
Tilman Schmidt          E-Mail: Tilman.Schmidt@sema.de (office)
Sema Group Koeln, Germany       tilman@schmidt.bn.uunet.de (private)
Received on Mon Mar 13 2000 - 01:01:51 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:52:04 MST