--- squid.initd 2009-11-28 14:32:58.000000000 +0200 +++ squid 2011-03-11 20:57:22.000000000 +0200 @@ -95,7 +95,8 @@ stop() { if [ -f /var/run/${SVCNAME}.pid ] ; then einfon "Waiting for squid to shutdown ." cnt=0 - while [ -f /var/run/${SVCNAME}.pid ] ; do + while pid=`cat /var/run/${SVCNAME}.pid 2>/dev/null` && + [ -n "$pid" ] && [ -d "/proc/$pid" ] ; do cnt=$(expr $cnt + 1) if [ $cnt -gt 60 ] ; then # Waited 120 seconds now. Fail.