r/vmhost: Retry vm-autostart if libvirt is down

If the _libvirt_ daemon has not fully started by the time `vm-autostart`
runs, we want it to fail and try again shortly.  To allow this, we first
attempt to connect to the _libvirt_ socket, and if that fails, stop
immediately and try again in a second.  This way, the first few VMs
don't get skipped with the assumption that they're missing, just because
the daemon wasn't ready yet.
This commit is contained in:
2025-07-28 18:20:50 -05:00
parent 4df047cf76
commit 2ee86f6344
2 changed files with 5 additions and 0 deletions

View File

@@ -5,6 +5,8 @@ if [ ! -r /etc/vm-autostart ]; then
exit 0
fi
virsh connect || exit
while read name args; do
if [ "${name}" = delay ]; then
sleep ${args}