Ensure the libvirt group exists in /etc/group so can actually work (#897)

This commit is contained in:
leechgrrl 2024-03-19 18:14:34 +10:00 committed by GitHub
parent d492edbf9c
commit 0922291295
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -144,5 +144,8 @@ setup-virtualization ACTION="":
echo "Adding SELinux context record for /dev/shm/looking-glass"
sudo semanage fcontext -a -t svirt_tmpfs_t /dev/shm/looking-glass
elif [[ "${OPTION,,}" =~ group ]]; then
if ! grep -q "^libvirt" /etc/group; then
grep '^libvirt' /usr/lib/group | sudo tee -a /etc/group > /dev/null
fi
sudo usermod -aG libvirt $USER
fi