Le Sat, 15 Feb 2014 22:04:17 +0100,
Guido Günther <a...@sigxcpu.org> a écrit :
> On Sat, Feb 15, 2014 at 08:27:32PM +0100, Laurent Bigonville wrote:
> >   dh_installinit --name=libvirt-bin --no-restart-on-upgrade --
> > defaults 28 72 dh_installinit --name=libvirt-guests
> > --no-restart-on-upgrade -- defaults 29 71 dh_systemd_start
> > --restart-after-upgrade
> > 
> > "--restart-after-upgrade" is passed to dh_systemd_start while
> This means we restart the daemon in the postinst without stopping it
> in the preinst.
> 
> > "--*no*-restart-on-upgrade" is passed to dh_installinit.
> And this one too. We're not stopping the daemon in the preinst and
> only restart it in the postinst.

OK I see now, you are stopping the daemon only if you are upgrading
from 0.6.0 or later. 0.6.0 is quite old now, the postinstall script
should maybe be cleanup a bit, see my attached patch.

Cheers,

Laurent Bigonville
diff -Nru libvirt-1.2.1/debian/libvirt-bin.postinst libvirt-1.2.1/debian/libvirt-bin.postinst
--- libvirt-1.2.1/debian/libvirt-bin.postinst	2014-01-17 06:15:07.000000000 +0100
+++ libvirt-1.2.1/debian/libvirt-bin.postinst	2014-02-16 11:15:53.000000000 +0100
@@ -96,28 +96,6 @@
         add_users_groups
         add_statoverrides
 
-	# libvirt from 0.6.0 on is safe to restart with running vms:
-	if [ -n "$2" ] &&  dpkg --compare-versions "$2" ge 0.6.0; then
-	    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-                invoke-rc.d libvirt-bin stop
-            else
-                /etc/init.d/libvirt-bin stop
-            fi
-	    sleep 1
-	fi
-
-	if dpkg --compare-versions "$2" lt "0.6.1-2"; then
-	    if [ -e /etc/rc2.d/S20libvirt-bin ] && \
-	       [ -e /etc/rc3.d/S20libvirt-bin ] && \
-	       [ -e /etc/rc4.d/S20libvirt-bin ] && \
-	       [ -e /etc/rc5.d/S20libvirt-bin ] && \
-	       [ -e /etc/rc0.d/K20libvirt-bin ] && \
-	       [ -e /etc/rc1.d/K20libvirt-bin ] && \
-	       [ -e /etc/rc6.d/K20libvirt-bin ]; then
-		update-rc.d -f libvirt-bin remove >/dev/null
-	    fi
-	fi
-
 	# Make sure the directories don't get removed on package removal since
 	# logrotate chokes otherwise.
 	for dir in qemu uml lxc; do
diff -Nru libvirt-1.2.1/debian/rules libvirt-1.2.1/debian/rules
--- libvirt-1.2.1/debian/rules	2014-01-17 06:15:07.000000000 +0100
+++ libvirt-1.2.1/debian/rules	2014-02-16 11:13:20.000000000 +0100
@@ -156,7 +156,7 @@
 
 override_dh_installinit:
 	dh_systemd_enable
-	dh_installinit --name=libvirt-bin --no-restart-on-upgrade -- defaults 28 72
+	dh_installinit --name=libvirt-bin --restart-after-upgrade -- defaults 28 72
 	dh_installinit --name=libvirt-guests --no-restart-on-upgrade -- defaults 29 71
 	dh_systemd_start --restart-after-upgrade
 

Reply via email to