Search squid archive

Error restarting squid from RPM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I don't know if this affects only the RPM packaging or squid sources. I'm
using Eliezer packages for CentOS 6, namely 3.4.3-1.el6.x86)64.

The issue is that sometimes "service squid restart" leaves old squid
processes running alongside newer ones. I have to "killall squid" and start
again to have a working proxy.

I see "squid -k shutdown" does not wait for all squid kids to stop, and
this makes init.d/squid to leave such broken restart.

I coud just increate SQUID_SHUTDOWN_TIMEOUT at /etc/sysconfig/squid so the init.d/squid script wait a little longer, but i think the restart command
should be more robust. So I propose the following simple change to the
init.d/squid script:

---------------
restart() {
 stop
 RETVAL=$?
 if [ $RETVAL -eq 0 ] ; then
 rm -rf $SQUID_PIDFILE_DIR/*
 start
 else
echo "Failure stopping squid or stopping squid took too long. Please check
before restarting."
 return 1
 fi
}
---------------

Instead of blindly calling start after stop, check if the stop function
returned ok or an error status code.

I think it's better having restart fail sometimes than having broken squid
processes after restart.

[]s, Fernando Lozano




[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux