Check that the lock file was not removed too early

When named fails to starts due to not being able to obtain
a lock on the lock file that lock file should remain.  Check
that the lock file exists before and after the attempt to
start a second instance of named.

(cherry picked from commit 811c9ee7d1)
This commit is contained in:
Mark Andrews 2023-10-26 15:07:58 +11:00
parent 534cadba3a
commit 74ab7e4660

View file

@ -81,12 +81,14 @@ status=$((status+ret))
n=$((n+1))
echo_i "verifying that named checks for conflicting named processes ($n)"
ret=0
test -f ns2/named.lock || ret=1
testpid=$(run_named ns2 named$n.run -c named-alt2.conf -D runtime-ns2-extra-2 -X named.lock)
test -n "$testpid" || ret=1
retry_quiet 10 check_named_log "another named process" ns2/named$n.run || ret=1
test -n "$testpid" && retry_quiet 10 check_pid $testpid || ret=1
test -n "$testpid" && kill -15 $testpid > kill$n.out 2>&1 && ret=1
test -n "$testpid" && retry_quiet 10 check_pid $testpid || ret=1
test -f ns2/named.lock || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))