diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-10-02 15:08:51 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-10-02 15:08:51 +0000 |
commit | c5bd88369aff02c5f5dbcba51ffeacfa23956f53 (patch) | |
tree | 854269849021ccd9bca7e256bd2e27eeb8ad18f7 /main/squid/squid.initd | |
parent | 87b8b701a1d266c16262bd6a3c45a3bd475bd49b (diff) | |
download | aports-c5bd88369aff02c5f5dbcba51ffeacfa23956f53.tar.bz2 aports-c5bd88369aff02c5f5dbcba51ffeacfa23956f53.tar.xz |
main/squid: remove pidfile if squis is not running
fixes #174
Diffstat (limited to 'main/squid/squid.initd')
-rw-r--r-- | main/squid/squid.initd | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/main/squid/squid.initd b/main/squid/squid.initd index beaea0b17a..2eaf1dd2af 100644 --- a/main/squid/squid.initd +++ b/main/squid/squid.initd @@ -50,7 +50,7 @@ checkconfig() { fi done - return 0 + squid -k parse } get_pidfile() { @@ -69,14 +69,19 @@ start() { } stop() { - local rc=0 + local rc=0 pid ebegin "Stopping squid" get_pidfile /usr/sbin/squid -k shutdown # Now we have to wait until squid has _really_ stopped. if [ -f "$PIDFILE" ] ; then - einfon "Waiting for squid to shutdown ." + pid=$(cat "$PIDFILE") + if [ -d /proc/$pid ]; then + einfon "Waiting for squid to shutdown ." + else + rm -f "$PIDFILE" + fi cnt=0 while [ -f "$PIDFILE" ] ; do cnt=$(expr $cnt + 1) |