Unverified Commit 6a4302f6 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Update QEMU termination logic

Replace the previous termination wait loop with a new one that checks the QEMU_PID file and the process state.
parent 86c17497
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -29,9 +29,6 @@ finish() {
    if [ -n "$pid" ] && isAlive "$pid"; then
      echo && error "Forcefully terminating QEMU, reason: $reason..."
      { kill -9 "$pid" || :; } 2>/dev/null
      while isAlive "$pid"; do
        sleep 0.2
      done
    fi
  fi

@@ -39,6 +36,10 @@ finish() {

  closeNetwork

  while [ -s "$QEMU_PID" ] && [ -n "$pid" ] && isAlive "$pid"; do
    sleep 0.2
  done
      
  echo && echo "❯ Shutdown completed!"

  exit "$reason"