Comment 15 for bug 573853

goraxe (goraxe) wrote :

the problem is squid waits for 30 (default) seconds to terminate, and prevents new squid process from spawning. I have just added this to my /etc/init/squid.conf

this causes upstart to wait for squid to fully exit before declaring it stopped, this means things like restart squid function as expected

post-stop script
        pidof \(squid\) >> /dev/null
        while [ $? -eq 0 ]; do
                sleep 1
                pidof \(squid\) || exit 0 >> /dev/null
        done
end script

The wait time for squid shutdown can be controlled with the 'shutdown_lifetime' variable
http://www.squid-cache.org/Versions/v2/2.7/cfgman/shutdown_lifetime.html