Ubuntu Pastebin

Paste from serge at Wed, 4 May 2016 17:06:40 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/debian/libvirt-daemon-system.preinst b/debian/libvirt-daemon-system.preinst
index fb01630..f0af565 100644
--- a/debian/libvirt-daemon-system.preinst
+++ b/debian/libvirt-daemon-system.preinst
@@ -41,7 +41,20 @@ case "$1" in
 	# This can be removed after 16.04 is released (though cloud archive
 	# may make it have to stick around longer)
 	if dpkg --compare-versions "$2" lt "1.3.3-2"; then
-	    systemctl stop libvirt-bin.service || true
+	     service_enabled=0
+	     if [ -h /etc/systemd/system/libvirtd.service ]; then
+	         rm -f /etc/systemd/system/libvirtd.service
+	     fi
+	     if [ -h /etc/systemd/system/multi-user.target.wants/libvirt-bin.service ]; then
+	         service_enabled=1
+	         rm -f /etc/systemd/system/multi-user.target.wants/libvirt-bin.service
+	     fi
+	     mv /lib/systemd/system/libvirt-bin.service /lib/systemd/system/libvirtd.service
+	     sed -i 's/Alias=libvirtd/Alias=libvirt-bin/' /lib/systemd/system/libvirtd.service
+	     mv /lib/systemd/system/libvirt-bin.socket /lib/systemd/system/libvirtd.socket
+	     if [ $service_enabled -eq 1 ]; then
+	         ln -s /lib/systemd/system/libvirtd.service /etc/systemd/system/multi-user.target.wants/libvirtd.service$
+	     fi
 	fi
     ;;
 
Download as text