Commit c5bd8836 authored by Natanael Copa's avatar Natanael Copa

main/squid: remove pidfile if squis is not running

fixes #174
parent 87b8b701
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
pkgname=squid pkgname=squid
pkgver=2.7.6 pkgver=2.7.6
_ver=2.7.STABLE6 _ver=2.7.STABLE6
pkgrel=11 pkgrel=12
pkgdesc="A full-featured Web proxy cache server." pkgdesc="A full-featured Web proxy cache server."
url="http://www.squid-cache.org" url="http://www.squid-cache.org"
install="squid.pre-install squid.pre-upgrade squid.post-install" install="squid.pre-install squid.pre-upgrade squid.post-install"
...@@ -279,7 +279,7 @@ errors_ukrainian_utf8() { ...@@ -279,7 +279,7 @@ errors_ukrainian_utf8() {
md5sums="6de3a6a7a56a7ecae092f2d31a04f039 squid-2.7.STABLE6.tar.bz2 md5sums="6de3a6a7a56a7ecae092f2d31a04f039 squid-2.7.STABLE6.tar.bz2
1f65e9dad473a027773c1f9a3eaf04b5 squid.initd 57fed05adc40acab6a5480ec7a014154 squid.initd
44b052db7910f386ef88ddcf69c9ba4e squid.confd 44b052db7910f386ef88ddcf69c9ba4e squid.confd
3827f71d940b47eb385a1a1d92a51d66 squid-2.7-gentoo.patch 3827f71d940b47eb385a1a1d92a51d66 squid-2.7-gentoo.patch
58823e0b86bc2dc71d270208b7b284b4 squid.logrotate" 58823e0b86bc2dc71d270208b7b284b4 squid.logrotate"
...@@ -50,7 +50,7 @@ checkconfig() { ...@@ -50,7 +50,7 @@ checkconfig() {
fi fi
done done
return 0 squid -k parse
} }
get_pidfile() { get_pidfile() {
...@@ -69,14 +69,19 @@ start() { ...@@ -69,14 +69,19 @@ start() {
} }
stop() { stop() {
local rc=0 local rc=0 pid
ebegin "Stopping squid" ebegin "Stopping squid"
get_pidfile get_pidfile
/usr/sbin/squid -k shutdown /usr/sbin/squid -k shutdown
# Now we have to wait until squid has _really_ stopped. # Now we have to wait until squid has _really_ stopped.
if [ -f "$PIDFILE" ] ; then 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 cnt=0
while [ -f "$PIDFILE" ] ; do while [ -f "$PIDFILE" ] ; do
cnt=$(expr $cnt + 1) cnt=$(expr $cnt + 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment