fix #6483: ensure cleanup of processes on exit
This commit is contained in:
parent
1cd3f3281b
commit
a84c61dd82
@ -36,11 +36,19 @@ function exit_skip() {
|
|||||||
# Exit, with error message (hard failure)
|
# Exit, with error message (hard failure)
|
||||||
function exit_fail() {
|
function exit_fail() {
|
||||||
echo $1
|
echo $1
|
||||||
kill `jobs -p` >/dev/null 2>/dev/null || true
|
|
||||||
wait
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Cleanup to run whenever we exit
|
||||||
|
function cleanup()
|
||||||
|
{
|
||||||
|
kill `jobs -p` >/dev/null 2>/dev/null || true
|
||||||
|
wait
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install cleanup handler (except for kill -9)
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
|
||||||
# Operations to run before the actual audit
|
# Operations to run before the actual audit
|
||||||
function pre_audit () {
|
function pre_audit () {
|
||||||
|
@ -36,11 +36,19 @@ function exit_skip() {
|
|||||||
# Exit, with error message (hard failure)
|
# Exit, with error message (hard failure)
|
||||||
function exit_fail() {
|
function exit_fail() {
|
||||||
echo $1
|
echo $1
|
||||||
kill `jobs -p` >/dev/null 2>/dev/null || true
|
|
||||||
wait
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Cleanup to run whenever we exit
|
||||||
|
function cleanup()
|
||||||
|
{
|
||||||
|
kill `jobs -p` >/dev/null 2>/dev/null || true
|
||||||
|
wait
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install cleanup handler (except for kill -9)
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
|
||||||
# Operations to run before the actual audit
|
# Operations to run before the actual audit
|
||||||
function pre_audit () {
|
function pre_audit () {
|
||||||
|
Loading…
Reference in New Issue
Block a user