1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

test: Remove pidfile after killing the process

Though unlikely keeping files in place may result in random process
killed.
This commit is contained in:
Marian Csontos 2016-03-23 12:18:08 +01:00
parent bb93a28bc1
commit 1b0775916b

View File

@ -435,6 +435,7 @@ kill_sleep_kill_() {
slow=$2 slow=$2
if test -s $pidfile ; then if test -s $pidfile ; then
pid=$(< $pidfile) pid=$(< $pidfile)
rm -f $pidfile
kill -TERM $pid 2>/dev/null || return 0 kill -TERM $pid 2>/dev/null || return 0
if test $slow -eq 0 ; then sleep .1 ; else sleep 1 ; fi if test $slow -eq 0 ; then sleep .1 ; else sleep 1 ; fi
kill -KILL $pid 2>/dev/null || true kill -KILL $pid 2>/dev/null || true