Skip to content
Snippets Groups Projects
Commit daf46feb authored by Laurent Bigonville's avatar Laurent Bigonville Committed by Guido Günther
Browse files

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
parent 998e7d4e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment