commit:     042c1165eee51da026e09671a8fc86266de281bf
Author:     Sven Wegener <swegener <AT> gentoo <DOT> org>
AuthorDate: Fri May  5 19:58:25 2017 +0000
Commit:     Sven Wegener <swegener <AT> gentoo <DOT> org>
CommitDate: Fri May  5 20:23:40 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=042c1165

net-dns/pdns: Remove non-compatible code from init script

Package-Manager: Portage-2.3.5, Repoman-2.3.2

 net-dns/pdns/files/pdns-r1                          | 21 +++++++++++++++++----
 .../{pdns-4.0.3-r1.ebuild => pdns-4.0.3-r2.ebuild}  |  0
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/net-dns/pdns/files/pdns-r1 b/net-dns/pdns/files/pdns-r1
index 84ba1a14108..a7a8c1ebfb9 100644
--- a/net-dns/pdns/files/pdns-r1
+++ b/net-dns/pdns/files/pdns-r1
@@ -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
 }
 

diff --git a/net-dns/pdns/pdns-4.0.3-r1.ebuild 
b/net-dns/pdns/pdns-4.0.3-r2.ebuild
similarity index 100%
rename from net-dns/pdns/pdns-4.0.3-r1.ebuild
rename to net-dns/pdns/pdns-4.0.3-r2.ebuild

Reply via email to