fix entrypoint script

This commit is contained in:
iceBear67
2026-07-13 17:38:42 +08:00
parent f42f90445b
commit ba17c2a47b
+8 -7
View File
@@ -3,13 +3,6 @@ set -euo pipefail
API_SOCKET="/hy.socks" API_SOCKET="/hy.socks"
_stop() {
echo "STOPPING!!"
ch-remote --api-socket "$API_SOCKET" power-button
}
trap _stop TERM INT
/usr/bin/cloud-hypervisor \ /usr/bin/cloud-hypervisor \
--kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \ --kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \
--disk path=/image/vm.raw,image_type=raw \ --disk path=/image/vm.raw,image_type=raw \
@@ -23,4 +16,12 @@ trap _stop TERM INT
CH_PID=$! CH_PID=$!
_stop() {
echo "STOPPING!!"
ch-remote --api-socket "$API_SOCKET" power-button
wait $CH_PID
}
trap _stop TERM INT
wait $CH_PID wait $CH_PID