[Pkg-libvirt-maintainers] Bug#730604: Bug#730604: Bug#730604: libvirt-bin: Please rename libvirt-bin.service back to libvirtd.service and use symlink or Alias= instead
Guido Günther
agx at sigxcpu.org
Fri Aug 1 14:29:39 UTC 2014
On Thu, Jul 31, 2014 at 06:08:51PM +0200, Laurent Bigonville wrote:
[..snip..]
> OK here is the patch that you can apply on the top of the experimental
> branch.
>
> I didn't test it though, but it looks OK to me.
Applied and uploaded while fixing up some other minor issues related
to the service rename.
Thanks,
-- Guido
>
> BTW, libvirt just got accepted.
>
> Cheers,
>
> Laurent Bigonville
> From aacf32e718a9b1d3ed486a39c34a1cc97635a6fc Mon Sep 17 00:00:00 2001
> From: Laurent Bigonville <bigon at bigon.be>
> Date: Thu, 31 Jul 2014 17:58:24 +0200
> Subject: [PATCH] Stop the daemon in the preinst script when renaming the
> .service file
>
> Stop the daemon in the preinst script instead of the postinst one when
> renaming the .service file as it now contains the "Restart=on-failure"
> option and blindly killing the daemon is not working anymore.
>
> This completes the fix for #730604
> ---
> debian/libvirt-daemon-system.postinst | 12 ---------
> debian/libvirt-daemon-system.preinst | 46 +++++++++++++++++++++++++++++++++++
> 2 files changed, 46 insertions(+), 12 deletions(-)
> create mode 100644 debian/libvirt-daemon-system.preinst
>
> diff --git a/debian/libvirt-daemon-system.postinst b/debian/libvirt-daemon-system.postinst
> index 73330ed..3c72dbc 100644
> --- a/debian/libvirt-daemon-system.postinst
> +++ b/debian/libvirt-daemon-system.postinst
> @@ -96,18 +96,6 @@ case "$1" in
> add_users_groups
> add_statoverrides
>
> - # When renaming the .service file, systemd might become confused, we
> - # need to ensure that the libvirtd daemon is fully stopped before
> - # trying to restart it again. (Bug: #730604)
> - if dpkg --compare-versions "$2" le "1.2.6-1~"; then
> - if [ -d /run/systemd/system ]; then
> - start-stop-daemon --stop --quiet --pidfile /var/run/libvirtd.pid \
> - --oknodo --exec /usr/sbin/libvirtd --retry 1
> - fi
> - # Remove everything we know about libvirt-bin.service
> - deb-systemd-helper purge libvirt-bin.service >/dev/null
> - fi
> -
> # Make sure the directories don't get removed on package removal since
> # logrotate chokes otherwise.
> for dir in qemu uml lxc; do
> diff --git a/debian/libvirt-daemon-system.preinst b/debian/libvirt-daemon-system.preinst
> new file mode 100644
> index 0000000..c4f4cf2
> --- /dev/null
> +++ b/debian/libvirt-daemon-system.preinst
> @@ -0,0 +1,46 @@
> +#!/bin/sh
> +# preinst script for libvirt-daemon-system
> +#
> +# see: dh_installdeb(1)
> +
> +set -e
> +
> +# summary of how this script can be called:
> +# * <new-preinst> `install'
> +# * <new-preinst> `install' <old-version>
> +# * <new-preinst> `upgrade' <old-version>
> +# * <old-preinst> `abort-upgrade' <new-version>
> +# for details, see http://www.debian.org/doc/debian-policy/ or
> +# the debian-policy package
> +
> +
> +case "$1" in
> + install|upgrade)
> + # When renaming the .service file, systemd might become confused, we
> + # need to ensure that the libvirtd daemon is fully stopped before
> + # trying to restart it again. (Bug: #730604)
> + if dpkg --compare-versions "$2" le-nl "1.2.6-1~"; then
> + if [ -d /run/systemd/system ]; then
> + invoke-rc.d libvirt-bin stop
> + fi
> + # Remove everything we know about libvirt-bin.service
> + deb-systemd-helper purge libvirt-bin.service >/dev/null
> + deb-systemd-helper unmask libvirt-bin.service >/dev/null
> + fi
> + ;;
> +
> + abort-upgrade)
> + ;;
> +
> + *)
> + echo "preinst called with unknown argument \`$1'" >&2
> + exit 1
> + ;;
> +esac
> +
> +# dh_installdeb will replace this with shell code automatically
> +# generated by other debhelper scripts.
> +
> +#DEBHELPER#
> +
> +exit 0
> --
> 2.0.1
>
More information about the Pkg-libvirt-maintainers
mailing list