[Bug 1791102] Re: udev postinst fails because kvm group already exists and is not a system group
Dan Streetman
1791102 at bugs.launchpad.net
Wed Jun 30 22:07:26 UTC 2021
please reopen if this is still an issue
** Changed in: systemd (Ubuntu)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1791102
Title:
udev postinst fails because kvm group already exists and is not a
system group
Status in systemd package in Ubuntu:
Invalid
Bug description:
The udev postinst failed like this on an upgrade in cosmic from 237-3ubuntu10.3 to 239-7ubuntu7:
Setting up udev (239-7ubuntu7) ...
Installing new version of config file /etc/udev/udev.conf ...
The group `kvm' already exists and is not a system group. Exiting.
dpkg: error processing package udev (--configure):
installed udev package post-installation script subprocess returned error exit status 1
The postinst script seemd to blindly add the kvm group. It is relying on the fact that the groups it's trying to add are already system groups, in which case addgroup --system doesn't fail
case "$1" in
configure)
# update/create hwdb before we (re)start udev
update_hwdb
# Add new system group used by udev rules
addgroup --quiet --system input
# Make /dev/kvm accessible to kvm group
addgroup --quiet --system kvm
But on this machine "kvm" has a high gid, so it's not deemed to be a
system group, in which case addgroup fails.
root at diamond:~# getent group input kvm
input:x:106:
kvm:x:1001:<big list of members sanitized>
root at diamond:~# addgroup --quiet --system input;echo $?
0
root at diamond:~# addgroup --quiet --system kvm;echo $?
The group `kvm' already exists and is not a system group. Exiting.
1
Someone, or some package, probably did an addgroup without --system some time ago. A quick grep in /var/lib/dpkg/info shows at least 3 packages trying to add a group called kvm:
root at diamond:~# grep -E "addgroup.*kvm" /var/lib/dpkg/info/*
/var/lib/dpkg/info/libvirt-daemon-system.postinst: addgroup --quiet --system kvm
/var/lib/dpkg/info/qemu-system-common.postinst: addgroup --quiet --system kvm || true
/var/lib/dpkg/info/qemu-system-common.preinst: addgroup --quiet --system kvm || true
/var/lib/dpkg/info/udev.postinst: addgroup --quiet --system kvm || /bin/true
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1791102/+subscriptions
More information about the foundations-bugs
mailing list