Bug #4947
Better handling of /etc/libvirt/qemu.conf configuration file
| Status: | Pending | Start date: | 12/01/2016 | |
|---|---|---|---|---|
| Priority: | Normal | Due 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-nodepostinst script checks the existence of theqemu.confconfiguration 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.confconfiguration file, in Debian Jessie, is managed by thelibvirt-qemu-systempackage and is marked as a Conffile. After theopennebula-nodepackage changes the existing configuration file, futurelibvirt-qemu-systempackage upgrades might be interrupted by thedebconfsystem 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.confconfiguration 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.confconfiguration file directly. Instead, check potential diversions using thedpkg-divertcommand and operate on that. If there are no diversions, create a diversion before writing the new configuration - this will ensure that upgrades of thelibvirt-qemu-systempackage work correctly.