From f42f90445b247196d647ae33a8ca2f16c49d22e3 Mon Sep 17 00:00:00 2001 From: iceBear67 Date: Mon, 13 Jul 2026 17:34:57 +0800 Subject: [PATCH] fix entrypoint --- scripts/entrypoint.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 9512c82..cfed4c6 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -3,6 +3,13 @@ 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 \ @@ -16,10 +23,4 @@ API_SOCKET="/hy.socks" CH_PID=$! -_stop() { - ch-remote --api-socket "$API_SOCKET" power-button -} - -trap _stop TERM - wait $CH_PID \ No newline at end of file