mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-17 06:48:51 +00:00
Merge pull request #10954 from kata-containers/topic/metrics-kata-deploy
Rework and fix metrics issues
This commit is contained in:
@@ -224,6 +224,23 @@ function kill_processes_before_start()
|
||||
kill_kata_components
|
||||
}
|
||||
|
||||
# Kills running shim and hypervisor components
|
||||
function kill_kata_components() {
|
||||
local ATTEMPTS=2
|
||||
local TIMEOUT="300s"
|
||||
local PID_NAMES=( "containerd-shim-kata-v2" "qemu-system-x86_64" "qemu-system-x86_64-tdx-experimental" "cloud-hypervisor" )
|
||||
|
||||
sudo systemctl stop containerd
|
||||
# iterate over the list of kata components and stop them
|
||||
for (( i=1; i<=ATTEMPTS; i++ )); do
|
||||
for PID_NAME in "${PID_NAMES[@]}"; do
|
||||
[[ ! -z "$(pidof ${PID_NAME})" ]] && sudo killall -w -s SIGKILL "${PID_NAME}" >/dev/null 2>&1 || true
|
||||
done
|
||||
sleep 1
|
||||
done
|
||||
sudo timeout -s SIGKILL "${TIMEOUT}" systemctl start containerd
|
||||
}
|
||||
|
||||
# Generate a random name - generally used when creating containers, but can
|
||||
# be used for any other appropriate purpose
|
||||
function random_name()
|
||||
|
Reference in New Issue
Block a user