udev postinst fails because kvm group already exists and is not a system group
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
New
|
Low
|
Unassigned |
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@diamond:~# getent group input kvm
input:x:106:
kvm:x:1001:<big list of members sanitized>
root@diamond:~# addgroup --quiet --system input;echo $?
0
root@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@diamond:~# grep -E "addgroup.*kvm" /var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
Changed in systemd (Ubuntu): | |
importance: | Undecided → Low |
please reopen if this is still an issue