Cleanup running dmesg process in local-up-cluster.sh

We have to cleanup the background job after the script otherwise we will
end up having them hanging around.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This commit is contained in:
Sascha Grunert 2025-01-27 17:44:22 +01:00
parent 7140b4910c
commit 5742f3deeb
No known key found for this signature in database
GPG Key ID: 09D97D153EF94D93

View File

@ -156,6 +156,9 @@ KUBE_CONTROLLERS="${KUBE_CONTROLLERS:-"*"}"
# Audit policy
AUDIT_POLICY_FILE=${AUDIT_POLICY_FILE:-""}
# dmesg command PID for cleanup
DMESG_PID=${DMESG_PID:-""}
# Stop right away if the build fails
set -e
@ -411,6 +414,9 @@ cleanup()
[[ -n "${ETCD_DIR-}" ]] && kube::etcd::clean_etcd_dir
fi
# Cleanup dmesg running in the background
[[ -n "${DMESG_PID-}" ]] && kill "$DMESG_PID"
exit 0
}
@ -812,6 +818,7 @@ function wait_coredns_available(){
# loop through and grab all things in dmesg
dmesg > "${LOG_DIR}/dmesg.log"
dmesg -w --human >> "${LOG_DIR}/dmesg.log" &
DMESG_PID=$!
fi
}