libvirt group gate: virt-manager alone justifies membership

Fresh-VM repro: user in yuri+wheel with virt-manager installed. Gate was
'pkg_installed libvirt', but virt-manager does NOT require the 'libvirt'
metapkg (verified vs F44 package page: requires libvirt-glib etc., client
side only) — so the usermod never fired.

Gate now: libvirt OR libvirt-daemon OR libvirt-daemon-driver-qemu OR
virt-manager packages, or an existing /usr/sbin/libvirtd binary.
This commit is contained in:
Pathfinder
2026-10-27 15:32:41 +01:00
parent 847e76614a
commit df56379556
+7 -1
View File
@@ -129,7 +129,13 @@ UNIT
# libvirt group: members manage qemu:///system without a polkit prompt. # libvirt group: members manage qemu:///system without a polkit prompt.
# Without this, virt-manager dies on "access denied by policy" even with # Without this, virt-manager dies on "access denied by policy" even with
# a working agent (VM-proven). Idempotent; applies after re-login. # a working agent (VM-proven). Idempotent; applies after re-login.
if pkg_installed libvirt; then #
# Gate on the DAEMON, not the 'libvirt' metapkg name: virt-manager only
# requires libvirt-glib client-side, so on a fresh VM libvirt can be
# functionally present via libvirt-daemon* without rpm -q libvirt passing
# (VM-proven: user stuck in yuri+wheel with virt-manager installed).
if pkg_installed libvirt libvirt-daemon libvirt-daemon-driver-qemu virt-manager \
|| [[ -x /usr/sbin/libvirtd ]]; then
local real_user="${SUDO_USER:-$USER}" local real_user="${SUDO_USER:-$USER}"
if ! id -nG "$real_user" 2>/dev/null | grep -qw libvirt; then if ! id -nG "$real_user" 2>/dev/null | grep -qw libvirt; then
info "Adding $real_user to the libvirt group (re-login to apply)..." info "Adding $real_user to the libvirt group (re-login to apply)..."