From 0de2685d568533fd6689069ef3d9bf4f64ec59c6 Mon Sep 17 00:00:00 2001 From: Stefan Bader Date: Mon, 26 Sep 2016 21:00:43 +0200 Subject: [PATCH] Fix upgrade migration from libvirt-bin to libvirtd The check was evaluated the wrong way but generally was-enabled should return successful when the service is considered to have been enabled. So use the return code instead of a string compare. Also, we need to call deb-systemd-helper with purge so the state files are removed as well as all links. Then the enable call later can re-create everything with the proper service names. Signed-off-by: Stefan Bader --- debian/libvirt-bin.preinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/libvirt-bin.preinst b/debian/libvirt-bin.preinst index 7f36813..fc1e957 100644 --- a/debian/libvirt-bin.preinst +++ b/debian/libvirt-bin.preinst @@ -29,12 +29,12 @@ case "$1" in install|upgrade) if dpkg --compare-versions "$2" lt-nl "1.3.3-2"; then if [ -d /run/systemd/system ]; then - if [ "$(deb-systemd-helper was-enabled libvirt-bin.service)" = "disabled" ]; then + if deb-systemd-helper was-enabled libvirt-bin.service; then touch /etc/libvirt/TMP_libvirt-bin-enabled else touch /etc/libvirt/TMP_libvirt-bin-disabled fi - rm -f /etc/systemd/system/libvirtd.service + deb-systemd-helper purge libvirt-bin.service fi invoke-rc.d libvirt-bin stop -- 1.9.1