From: Sven Wegener Date: Fri, 5 May 2017 19:58:25 +0000 (+0000) Subject: net-dns/pdns: Remove non-compatible code from init script X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=042c1165eee51da026e09671a8fc86266de281bf;p=gentoo.git net-dns/pdns: Remove non-compatible code from init script Package-Manager: Portage-2.3.5, Repoman-2.3.2 --- diff --git a/net-dns/pdns/files/pdns-r1 b/net-dns/pdns/files/pdns-r1 index 84ba1a141084..a7a8c1ebfb90 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