mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-26 13:48:54 -04:00
Wait until a cache dump completes instead of waiting for a fixed amount of time
Dumping the cache is an asynchronous operation, so sleeping for a fixed amount of time after running "rndc dumpdb" is imperfect as dumping cache contents may take longer than expected on slower machines. Instead of always sleeping for 1 second, wait until the "; Dump complete" line appears in the dump or 10 seconds pass, whichever comes first.
This commit is contained in:
parent
aeea1faf01
commit
2bbff06d36
1 changed files with 5 additions and 1 deletions
|
|
@ -57,7 +57,11 @@ EOF
|
||||||
|
|
||||||
dump_cache () {
|
dump_cache () {
|
||||||
$RNDC $RNDCOPTS dumpdb -cache _default
|
$RNDC $RNDCOPTS dumpdb -cache _default
|
||||||
sleep 1
|
for i in 0 1 2 3 4 5 6 7 8 9
|
||||||
|
do
|
||||||
|
grep '^; Dump complete$' ns2/named_dump.db > /dev/null && break
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
mv ns2/named_dump.db ns2/named_dump.db.$n
|
mv ns2/named_dump.db ns2/named_dump.db.$n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue