Bug #4947

Better handling of /etc/libvirt/qemu.conf configuration file

Added by Maciej Delmanowski over 4 years ago.

Status:PendingStart date:12/01/2016
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Packaging
Target version:-
Resolution: Pull request:
Affected Versions:OpenNebula 5.2

Description

The openebula-node Debian package does not handle the /etc/libvirt/qemu.conf configuration file in a sane way. There are two issues:

  • The opennebula-node postinst script checks the existence of the qemu.conf configuration file, and if it finds one, the existing configuration file is moved out of the way and replaced by a stub configuration file with minimum set of configuration options required by OpenNebula. This completely destroys existing configuration created by the local system administrator, without confirmation.
  • The /etc/libvirt/qemu.conf configuration file, in Debian Jessie, is managed by the libvirt-qemu-system package and is marked as a Conffile. After the opennebula-node package changes the existing configuration file, future libvirt-qemu-system package upgrades might be interrupted by the debconf system asking the user what to do with the changed configuration file.

The above issues affect automated installation and management of OpenNebula nodes to the point, where potential users (me included) might drop the usage of the opennebula-node package completely and just apply the required changes using their configuration management system of choice. Therefore I think that the current postinst script included in the package should be fixed. Suggested solutions:

  • Check if the /etc/libvirt/qemu.conf configuration file contains the desired configuration (user/group/dynamic_ownership) before blindly overwriting it.
  • If the script decides to write the new configuration file with the required changes, don't overwrite the /etc/libvirt/qemu.conf configuration file directly. Instead, check potential diversions using the dpkg-divert command and operate on that. If there are no diversions, create a diversion before writing the new configuration - this will ensure that upgrades of the libvirt-qemu-system package work correctly.

Also available in: Atom PDF