newvm: Stop waiting for VM events if install fails

If `virt-install` fails before the VM starts for the first time; the
`virsh event` process running in the background will never terminate and
therefore the main process will `wait` forever.  We can avoid this by
killing the background process if `virt-install` fails.
unifi-restore
Dustin 2025-07-14 15:47:12 -05:00
parent 51e8cae618
commit b4f5b419e1
1 changed files with 1 additions and 1 deletions

View File

@ -205,5 +205,5 @@ virsh metadata ${name} --live --config ${METADATA_XMLNS} dch \
"<metadata><groups>${groups_xml}</groups></metadata>"
) &
virt-install "$@"
virt-install "$@" || kill $!
wait