What were you trying to do that didn't work?
After updating libvirt from 6 to 8, we found out that the `virsh` commands hang when run in the background. In this specific case, we experienced this behavior with the VirtualDomain resource agent (script) in a Pacemaker cluster running on RHEL 8.7.
After investigating this issue, we (rhn-support-nwahl ++) found out that manually updating the polkit package to the version `0.115-15.el8` makes the issue disappear and the `virsh` command (and, therefore, the script) doesn't hang anymore.
More information:
https://serverfault.com/questions/1105733/virsh-command-hangs-when-script-runs-in-the-background
https://serverfault.com/a/1110805
https://gitlab.com/libvirt/libvirt/-/issues/366
Please provide the package NVR for which bug is seen:
- libvirt-8.0.0-19.2.module+el8.8.0+18944+7f5acf75.x86_64
- polkit-0.115-13.el8_5.2.x86_64
How reproducible:
Always.
Steps to reproduce
1.- Upgrade libvirt from version 6 to 8, i.e., to libvirt-8.0.0-19.2.module+el8.8.0+18944+7f5acf75.x86_64.
2.- Run `virsh` in the background (either interactively or from within a script):
# virsh --connect=qemu:///system --quiet domstate testvm &
3.- It will hang indefinitely.
Expected results
The `virsh` command will finish immediately and won't hang.
Actual results
The `virsh` command (and, therefore, any script from which it's called) hangs indefinitely.