From 36c6c7778b4245003709b73ec831fa8b5bacc68c Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Thu, 13 Feb 2025 15:33:36 +0100 Subject: [PATCH] Use `sudo` for dmesg in hack/local-up-cluster.sh Kernels may have `kernel.dmesg_restrict = 1` set which requires root access to see dmesg. We're now using `sudo` to mitigate that. Signed-off-by: Sascha Grunert --- hack/local-up-cluster.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 1715ec91d8d..82feb1e4d38 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -411,7 +411,7 @@ cleanup() fi # Cleanup dmesg running in the background - [[ -n "${DMESG_PID-}" ]] && kill "$DMESG_PID" + [[ -n "${DMESG_PID-}" ]] && sudo kill "$DMESG_PID" 2>/dev/null exit 0 } @@ -812,8 +812,10 @@ function wait_coredns_available(){ echo "6" | sudo tee /proc/sys/kernel/printk # loop through and grab all things in dmesg - dmesg > "${LOG_DIR}/dmesg.log" - dmesg -w --human >> "${LOG_DIR}/dmesg.log" & + # shellcheck disable=SC2024 + sudo dmesg > "${LOG_DIR}/dmesg.log" + # shellcheck disable=SC2024 + sudo dmesg -w --human >> "${LOG_DIR}/dmesg.log" & DMESG_PID=$! fi }