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:09:58 +0000 |
commit | a3a664b544cd172d6bdfd05585f2564d4f0fc7ad (patch) | |
tree | 854269849021ccd9bca7e256bd2e27eeb8ad18f7 | |
parent | 41ad9decf4fcaf395e422a2920fd3c4806b192e7 (diff) | |
download | alpine_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/APKBUILD | 4 | ||||
-rw-r--r-- | main/squid/squid.initd | 11 |
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 @@ | |||
3 | pkgname=squid | 3 | pkgname=squid |
4 | pkgver=2.7.6 | 4 | pkgver=2.7.6 |
5 | _ver=2.7.STABLE6 | 5 | _ver=2.7.STABLE6 |
6 | pkgrel=11 | 6 | pkgrel=12 |
7 | pkgdesc="A full-featured Web proxy cache server." | 7 | pkgdesc="A full-featured Web proxy cache server." |
8 | url="http://www.squid-cache.org" | 8 | url="http://www.squid-cache.org" |
9 | install="squid.pre-install squid.pre-upgrade squid.post-install" | 9 | install="squid.pre-install squid.pre-upgrade squid.post-install" |
@@ -279,7 +279,7 @@ errors_ukrainian_utf8() { | |||
279 | 279 | ||
280 | 280 | ||
281 | md5sums="6de3a6a7a56a7ecae092f2d31a04f039 squid-2.7.STABLE6.tar.bz2 | 281 | md5sums="6de3a6a7a56a7ecae092f2d31a04f039 squid-2.7.STABLE6.tar.bz2 |
282 | 1f65e9dad473a027773c1f9a3eaf04b5 squid.initd | 282 | 57fed05adc40acab6a5480ec7a014154 squid.initd |
283 | 44b052db7910f386ef88ddcf69c9ba4e squid.confd | 283 | 44b052db7910f386ef88ddcf69c9ba4e squid.confd |
284 | 3827f71d940b47eb385a1a1d92a51d66 squid-2.7-gentoo.patch | 284 | 3827f71d940b47eb385a1a1d92a51d66 squid-2.7-gentoo.patch |
285 | 58823e0b86bc2dc71d270208b7b284b4 squid.logrotate" | 285 | 58823e0b86bc2dc71d270208b7b284b4 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 | ||
56 | get_pidfile() { | 56 | get_pidfile() { |
@@ -69,14 +69,19 @@ start() { | |||
69 | } | 69 | } |
70 | 70 | ||
71 | stop() { | 71 | stop() { |
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) |