]> git.pld-linux.org Git - packages/squid.git/commitdiff
- check for squid.pid not whole process tree
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 23 Nov 2007 12:57:51 +0000 (12:57 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    squid.init -> 1.49

squid.init

index 3c01484ab5a9ae74f3f5a981f410100073e52872..03c8a6a49c9ecc2ba38ad5bfd8a2cd0fb7dde350 100644 (file)
@@ -88,30 +88,25 @@ stop() {
        if [ -f /var/lock/subsys/squid ]; then
                # Stop daemons.
                msg_stopping Squid
-               if [ -f /var/run/squid.pid ]; then
-                       PID=$(filter_chroot $(cat /var/run/squid.pid))
-                       if [ -z "$PID" ]; then
-                               PID=0
-                       fi
-               else
-                       PID=0
-               fi
                killproc squid
-               RETVAL=$?
-               if [ $PID != 0 ]; then
+
+               if [ -f /var/run/squid.pid ]; then
                        show "Waiting for Squid to stop"
                        busy
+
                        timeout=0
-                       while ps -U squid -o user | grep -q ^squid
-                       do
+                       while : ; do
+                               [ ! -f /var/run/squid.pid ] || break
                                if [ $timeout -ge $SQUID_SHUTDOWN_TIMEOUT ]; then
-                                   break
+                                       RETVAL=1
+                                       break
                                fi
-                               sleep 1
-                               timeout=$((timeout + 1))
+                               sleep 1 && echo -n "."
+                               timeout=$((timeout+1))
                        done
                        ok
                fi
+
                rm -f /var/lock/subsys/squid >/dev/null 2>&1
        else
                msg_not_running Squid
This page took 0.062622 seconds and 4 git commands to generate.