libvirt group: gate on daemon/virt-manager, not the metapkg #5

Merged
yuri merged 2 commits from fix/libvirt-group-gate into main 2026-10-27 15:58:59 +01:00
Showing only changes of commit df56379556 - Show all commits
+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)..."