[squid-users] Squid shutdown behaviour

From: N3O <strutter79_at_gmail.com>
Date: Thu, 17 Mar 2011 11:10:18 -0400

Hello

I'm having a problem trying to shutdown a squid instance. Version 3.1.11
when i do a service squid stop or /etc/init.d/squid stop it shows:

[root_at_ip-10-170-99-79 subsys]# ps -ef | grep squid
root 3662 1 0 10:40 ? 00:00:00 squid
squid 3780 3662 0 10:55 ? 00:00:00 (squid)
squid 3783 3780 0 10:55 ? 00:00:00 (unlinkd)
root 3825 2379 0 10:58 pts/0 00:00:00 grep squid
[root_at_ip-10-170-99-79 subsys]# service squid stop
Stopping squid: ..................................................
[root_at_ip-10-170-99-79 subsys]# ps -ef | grep squid
root 3662 1 0 10:40 ? 00:00:00 squid
squid 3864 3662 0 10:59 ? 00:00:00 (squid)
squid 3867 3864 0 10:59 ? 00:00:00 (unlinkd)
root 3903 2379 0 11:00 pts/0 00:00:00 grep squid

the same happens with /etc/init.d/squid stop

[root_at_ip-10-170-99-79 subsys]# ps -ef | grep squid
root 3662 1 0 10:40 ? 00:00:00 squid
squid 3946 3662 0 11:01 ? 00:00:00 (squid)
squid 3949 3946 0 11:01 ? 00:00:00 (unlinkd)
root 3985 2379 0 11:04 pts/0 00:00:00 grep squid
[root_at_ip-10-170-99-79 subsys]# /etc/init.d/squid stop
Stopping squid: ..................................................
[root_at_ip-10-170-99-79 subsys]# ps -ef | grep squid
root 3662 1 0 10:40 ? 00:00:00 squid
squid 4019 3662 0 11:05 ? 00:00:00 (squid)
squid 4022 4019 0 11:05 ? 00:00:00 (unlinkd)
root 4056 2379 0 11:07 pts/0 00:00:00 grep squid
[root_at_ip-10-170-99-79 subsys]#

It doesnt stop squid, it seems that is just reloading it???
is this normal???

thanks!

This is my /etc/init.d/squid file:

      1 #!/bin/bash
      2 # squid This shell script takes care of starting and stopping
      3 # Squid Internet Object Cache
      4 #
      5 # chkconfig: 345 90 25
      6 # description: Squid - Internet Object Cache. Internet object
caching is \
      7 # a way to store requested Internet objects (i.e., data
available \
      8 # via the HTTP, FTP, and gopher protocols) on a system
closer to the \
      9 # requesting site than to the source. Web browsers can
then use the \
     10 # local Squid cache as a proxy HTTP server, reducing
access time as \
     11 # well as bandwidth consumption.
     12 #pidfile: /usr/local/squid/var/run/squid.pid
     13 # config: /etc/squid/squid.conf
     14
     15 ### BEGIN INIT INFO
     16 # Provides: squid
     17 # Required-Start: $network
     18 # Required-Stop: $network
     19 # Should-Start: $named icapd
     20 # Should-Stop: $named
     21 # Short-Description: Starts the squid daemon
     22 # Description: Squid is a full-featured web proxy cache with
support for \
     23 # many protocols, cache
hierarchies, transparent proxy and \
     24 # many other features.
     25 #
     26 ### END INIT INFO
     27
     28
     29 PATH=/usr/bin:/sbin:/bin:/usr/sbin
     30 export PATH
     31
     32 # Source function library.
     33 . /etc/rc.d/init.d/functions
     34
     35 # Source networking configuration.
     36 . /etc/sysconfig/network
     37
     38 # Check that networking is up.
     39 [ ${NETWORKING} = "no" ] && exit 0
     40
     41 # check if the squid conf file is present
     42 [ -f /etc/squid/squid.conf ] || exit 0
     43
     44 if [ -f /etc/sysconfig/squid ]; then
     45 . /etc/sysconfig/squid
     46 fi
     47
     48 # don't raise an error if the config file is incomplete
     49 # set defaults instead:
     50 SQUID_OPTS=${SQUID_OPTS:-""}
     51 SQUID_PIDFILE_TIMEOUT=${SQUID_PIDFILE_TIMEOUT:-20}
     52 SQUID_SHUTDOWN_TIMEOUT=${SQUID_SHUTDOWN_TIMEOUT:-100}
     53
     54 # determine the name of the squid binary
     55 [ -f /usr/sbin/squid ] && SQUID=squid
     56 [ -z "$SQUID" ] && exit 0
     57
     58 prog="$SQUID"
     59
     60 # determine which one is the cache_swap directory
     61 CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid/squid.conf | \
     62 grep cache_dir | awk '{ print $3 }'`
     63 [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid
     64
     65 RETVAL=0
     66
     67 start() {
     68 # taken from udev
     69 case "$(uname -r)" in
     70 2.[012345].*)
     71 printf "squid requires a 2.6.x kernel (with epoll support). "
     72 failure; echo
     73 exit 1
     74 ;;
     75 esac
     76
     77 if [ ! -d $adir/00 ]; then
     78 printf "init_cache_dir %s... " "$adir"
     79 $SQUID -z -F -D >> /var/log/squid/squid.out 2>&1
     80 fi
     81
     82 printf "Starting %s: " "$prog"
     83 $SQUID $SQUID_OPTS >> /var/log/squid/squid.out 2>&1
     84 RETVAL=$?
     85 if [ $RETVAL -eq 0 ]; then
     86 timeout=0;
     87 while : ; do
     88 [ ! -f /usr/local/squid/var/run/squid.pid ] || break
     89 if [ $timeout -ge $SQUID_PIDFILE_TIMEOUT ]; then
     90 RETVAL=1
     91 break
     92 fi
     93 sleep 1 && printf "."
     94 timeout=$((timeout+1))
     95 done
     96 fi
     97
     98 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SQUID
     99 [ $RETVAL -eq 0 ] && success
    100 [ $RETVAL -ne 0 ] && failure
    101 echo
    102 return $RETVAL
    103 }
    104
    105 stop() {
    106 printf "Stopping %s: " "$prog"
    107 $SQUID -k check >> /var/log/squid/squid.out 2>&1
    108 RETVAL=$?
    109 if [ $RETVAL -eq 0 ] ; then
    110 $SQUID -k shutdown &
    111 rm -f /var/lock/subsys/$SQUID
    112 timeout=0
    113 while : ; do
    114 [ -f /usr/local/squid/var/run/squid.pid ] || break
    115 if [ $timeout -ge $SQUID_SHUTDOWN_TIMEOUT ]; then
    116 echo
    117 return 1
    118 fi
    119 sleep 2 && printf "."
    120 timeout=$((timeout+2))
    121 done
    122 success; echo
    123 else
    124 failure; echo
    125 fi
    126 return $RETVAL
    127 }
    128
    129 reload() {
    130 $SQUID $SQUID_OPTS -k reconfigure
    131 }
    132
    133 restart() {
    134 stop
    135 start
    136 }
    137
    138 condrestart() {
    139 [ -e /var/lock/subsys/squid ] && restart || :
    140 }
    141
    142 rhstatus() {
    143 status $SQUID
    144 $SQUID -k check
    145 }
    146
    147 probe() {
    148 return 0
    149 }
    150
    151 case "$1" in
    152 start)
    153 start
    154 ;;
    155
    156 stop)
    157 stop
    158 ;;
    159
    160 reload)
    161 reload
    162 ;;
    163
    164 restart)
    165 restart
    166 ;;
    167
    168 condrestart)
    169 condrestart
    170 ;;
    171
    172 status)
    173 rhstatus
    174 ;;
    175
    176 probe)
    177 exit 0
    178 ;;
    179
    180 *)
    181 printf "Usage: %s
{start|stop|status|reload|restart|condrestart}\n" "$0"
    182 exit 1
    183 esac
    184
    185 exit $?
Received on Thu Mar 17 2011 - 15:10:26 MDT

This archive was generated by hypermail 2.2.0 : Fri Mar 18 2011 - 12:00:03 MDT