From ba17c2a47b343d4ac267687e4630616b3ad4029e Mon Sep 17 00:00:00 2001 From: iceBear67 Date: Mon, 13 Jul 2026 17:38:42 +0800 Subject: [PATCH] fix entrypoint script --- scripts/entrypoint.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index cfed4c6..dfcce22 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -3,13 +3,6 @@ set -euo pipefail API_SOCKET="/hy.socks" -_stop() { - echo "STOPPING!!" - ch-remote --api-socket "$API_SOCKET" power-button -} - -trap _stop TERM INT - /usr/bin/cloud-hypervisor \ --kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \ --disk path=/image/vm.raw,image_type=raw \ @@ -23,4 +16,12 @@ trap _stop TERM INT CH_PID=$! +_stop() { + echo "STOPPING!!" + ch-remote --api-socket "$API_SOCKET" power-button + wait $CH_PID +} + +trap _stop TERM INT + wait $CH_PID \ No newline at end of file