net-dns/pdns: Remove non-compatible code from init script
authorSven Wegener <swegener@gentoo.org>
Fri, 5 May 2017 19:58:25 +0000 (19:58 +0000)
committerSven Wegener <swegener@gentoo.org>
Fri, 5 May 2017 20:23:40 +0000 (20:23 +0000)
Package-Manager: Portage-2.3.5, Repoman-2.3.2

net-dns/pdns/files/pdns-r1
net-dns/pdns/pdns-4.0.3-r2.ebuild [moved from net-dns/pdns/pdns-4.0.3-r1.ebuild with 100% similarity]

index 84ba1a1410849d8d26c1c4000586717b60933dc8..a7a8c1ebfb9053f44ef0cd4efdc056972512936c 100644 (file)
@@ -4,6 +4,7 @@
 
 PDNS_CONFIGDIR="${PDNS_CONFIGDIR:-/etc/powerdns}"
 PDNS_SOCKETDIR="${PDNS_SOCKETDIR:-/var/lib/powerdns}"
+PDNS_STOP_TIMEOUT="${PDNS_STOP_TIMEOUT:-10}"
 
 name="PowerDNS Authoritative Server"
 description="Authoritative name server"
@@ -45,12 +46,24 @@ status() {
 stop() {
        default_stop || return
        _ping || return 0
+       wait_for_stop
+}
 
-       local sleep
-       for sleep in 0.1 0.2 0.3 0.4; do
-               sleep "${sleep}"
-               _ping || return 0
+wait_for_stop() {
+       einfon "Waiting for ${name} to stop"
+
+       local timeout="${PDNS_STOP_TIMEOUT}"
+       while [ "${timeout}" -gt 0 ]; do
+               sleep 1
+               if ! _ping; then
+                       echo
+                       return 0
+               fi
+               : $(( timeout -= 1 ))
+               echo -n .
        done
+
+       echo
        return 1
 }