[Slackbuilds-users] Squid: rc.squid doesn't stop Squid correctly
xgizzmo at slackbuilds.org
xgizzmo at slackbuilds.org
Thu Oct 6 16:51:32 UTC 2011
On Thursday 06 October 2011 03:47:48 Nicolas Kovacs wrote:
> Le 05/10/2011 13:48, Helmut Hullen a écrit :
> >
> > "squid" needs some time for shutting down - are these processes still
> > running after (about) 2 minutes?
> >
>
> OK, I investigated a little bit, and I found a couple of reasons why
> Squid wouldn't shutdown correctly.
>
> A peek in /var/log/squid/cache.log indicated this:
>
> ...
> WARNING: Could not write pid file
> ...
>
> So I explicitly defined a PID file in squid.conf:
>
> ...
> pid_filename /var/run/squid/squid.pid
> ...
>
> Now the PID file is written correctly, but still, running:
>
> # /etc/rc.d/rc.squid stop
>
> wouldn't stop the squid processes. Took a peek in the rc.file, and here
> it is:
>
> --8<--------------------------------------------------------
> squid_stop() {
> COUNTDOWN=$(awk '/^shutdown_lifetime/ {print $2}' $SQUIDCFG)
> [ -z "$COUNTDOWN" ] && COUNTDOWN=30
>
> echo -n "Shutting down Squid in $COUNTDOWN seconds: "
> $SQUIDCMD -k shutdown 2> /dev/null
> while $SQUIDCMD -k check 2> /dev/null ; do
> sleep 1
> echo -n .
> COUNTDOWN=$[ $COUNTDOWN - 1 ]
> if [ $COUNTDOWN -le 0 ] ; then
> $SQUIDCMD -k interrupt 2> /dev/null
> sleep 1
> break
> fi
> done
> echo
> }
> --8<--------------------------------------------------------
>
> Now I added the following option to squid.conf:
>
> shutdown_lifetime 30 seconds
>
> From here, it got parsed correctly, and now everything is working fine.
>
> cheers,
>
> Niki
I can not reproduce any of these problems on a clean system with a
fresh build and install of squid.
--dsomero
More information about the SlackBuilds-users
mailing list