Skip to content

Commit 6487606

Browse files
authored
Merge pull request kubernetes#130143 from saschagrunert/dmesg-root
Use `sudo` for dmesg in hack/local-up-cluster.sh
2 parents d36737c + 36c6c77 commit 6487606

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

hack/local-up-cluster.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ cleanup()
411411
fi
412412

413413
# Cleanup dmesg running in the background
414-
[[ -n "${DMESG_PID-}" ]] && kill "$DMESG_PID"
414+
[[ -n "${DMESG_PID-}" ]] && sudo kill "$DMESG_PID" 2>/dev/null
415415

416416
exit 0
417417
}
@@ -812,8 +812,10 @@ function wait_coredns_available(){
812812
echo "6" | sudo tee /proc/sys/kernel/printk
813813

814814
# loop through and grab all things in dmesg
815-
dmesg > "${LOG_DIR}/dmesg.log"
816-
dmesg -w --human >> "${LOG_DIR}/dmesg.log" &
815+
# shellcheck disable=SC2024
816+
sudo dmesg > "${LOG_DIR}/dmesg.log"
817+
# shellcheck disable=SC2024
818+
sudo dmesg -w --human >> "${LOG_DIR}/dmesg.log" &
817819
DMESG_PID=$!
818820
fi
819821
}

0 commit comments

Comments
 (0)