From 5742f3deeb9b81fca97654716115604eb3ff71b7 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Mon, 27 Jan 2025 17:44:22 +0100 Subject: [PATCH] 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 --- hack/local-up-cluster.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index f30bb723d3d..ce5613a9967 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -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 }