aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-10-02 15:08:51 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-10-02 15:09:58 +0000
commita3a664b544cd172d6bdfd05585f2564d4f0fc7ad (patch)
tree854269849021ccd9bca7e256bd2e27eeb8ad18f7
parent41ad9decf4fcaf395e422a2920fd3c4806b192e7 (diff)
downloadalpine_aports-a3a664b544cd172d6bdfd05585f2564d4f0fc7ad.tar.bz2
alpine_aports-a3a664b544cd172d6bdfd05585f2564d4f0fc7ad.tar.xz
alpine_aports-a3a664b544cd172d6bdfd05585f2564d4f0fc7ad.zip
main/squid: remove pidfile if squis is not running
fixes #174
-rw-r--r--main/squid/APKBUILD4
-rw-r--r--main/squid/squid.initd11
2 files changed, 10 insertions, 5 deletions
diff --git a/main/squid/APKBUILD b/main/squid/APKBUILD
index dd4b80c76a..01f7bfa743 100644
--- a/main/squid/APKBUILD
+++ b/main/squid/APKBUILD
@@ -3,7 +3,7 @@
3pkgname=squid 3pkgname=squid
4pkgver=2.7.6 4pkgver=2.7.6
5_ver=2.7.STABLE6 5_ver=2.7.STABLE6
6pkgrel=11 6pkgrel=12
7pkgdesc="A full-featured Web proxy cache server." 7pkgdesc="A full-featured Web proxy cache server."
8url="http://www.squid-cache.org" 8url="http://www.squid-cache.org"
9install="squid.pre-install squid.pre-upgrade squid.post-install" 9install="squid.pre-install squid.pre-upgrade squid.post-install"
@@ -279,7 +279,7 @@ errors_ukrainian_utf8() {
279 279
280 280
281md5sums="6de3a6a7a56a7ecae092f2d31a04f039 squid-2.7.STABLE6.tar.bz2 281md5sums="6de3a6a7a56a7ecae092f2d31a04f039 squid-2.7.STABLE6.tar.bz2
2821f65e9dad473a027773c1f9a3eaf04b5 squid.initd 28257fed05adc40acab6a5480ec7a014154 squid.initd
28344b052db7910f386ef88ddcf69c9ba4e squid.confd 28344b052db7910f386ef88ddcf69c9ba4e squid.confd
2843827f71d940b47eb385a1a1d92a51d66 squid-2.7-gentoo.patch 2843827f71d940b47eb385a1a1d92a51d66 squid-2.7-gentoo.patch
28558823e0b86bc2dc71d270208b7b284b4 squid.logrotate" 28558823e0b86bc2dc71d270208b7b284b4 squid.logrotate"
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() {
50 fi 50 fi
51 done 51 done
52 52
53 return 0 53 squid -k parse
54} 54}
55 55
56get_pidfile() { 56get_pidfile() {
@@ -69,14 +69,19 @@ start() {
69} 69}
70 70
71stop() { 71stop() {
72 local rc=0 72 local rc=0 pid
73 ebegin "Stopping squid" 73 ebegin "Stopping squid"
74 get_pidfile 74 get_pidfile
75 /usr/sbin/squid -k shutdown 75 /usr/sbin/squid -k shutdown
76 76
77 # Now we have to wait until squid has _really_ stopped. 77 # Now we have to wait until squid has _really_ stopped.
78 if [ -f "$PIDFILE" ] ; then 78 if [ -f "$PIDFILE" ] ; then
79 einfon "Waiting for squid to shutdown ." 79 pid=$(cat "$PIDFILE")
80 if [ -d /proc/$pid ]; then
81 einfon "Waiting for squid to shutdown ."
82 else
83 rm -f "$PIDFILE"
84 fi
80 cnt=0 85 cnt=0
81 while [ -f "$PIDFILE" ] ; do 86 while [ -f "$PIDFILE" ] ; do
82 cnt=$(expr $cnt + 1) 87 cnt=$(expr $cnt + 1)