]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
UBUNTU: [Packaging] Bind hv_vss_daemon startup to hv_vss device
authorMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Mon, 24 Aug 2020 16:59:47 +0000 (13:59 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 4 Sep 2020 19:30:13 +0000 (16:30 -0300)
BugLink: https://bugs.launchpad.net/bugs/1891224
Update the systemd service for the vss daemon and add a new udev rule
to ensure the service will not fail in case vss is not enabled for the
guest.

The udev rules is responsible for starting the service only when the
vss device is available. In the unit file, the service is now bound to
the device unit, so the service can be stopped if the device is
removed. And the service is also conditioned to the existence of the
device, this way we avoid starting and stopping the service during
boot if the device is not available.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
debian/linux-cloud-tools-common.hv-vss-daemon.service
debian/linux-cloud-tools-common.hv-vss-daemon.udev [new file with mode: 0644]
debian/rules.d/3-binary-indep.mk

index 20717a7bd15997e0b9daf4f0a573232d51c63126..4ff9e796b3b21f738eb681cf1c539c6f46d78237 100644 (file)
@@ -4,6 +4,8 @@
 [Unit]
 Description=Hyper-V VSS Protocol Daemon
 ConditionVirtualization=microsoft
+ConditionPathExists=/dev/vmbus/hv_vss
+BindsTo=sys-devices-virtual-misc-vmbus\x21hv_vss.device
 
 [Service]
 ExecStart=/usr/sbin/hv_vss_daemon -n
diff --git a/debian/linux-cloud-tools-common.hv-vss-daemon.udev b/debian/linux-cloud-tools-common.hv-vss-daemon.udev
new file mode 100644 (file)
index 0000000..f4b9a91
--- /dev/null
@@ -0,0 +1 @@
+SUBSYSTEM=="misc", KERNEL=="vmbus/hv_vss", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv-vss-daemon.service"
index d79e866dfe2e3419881be2d3cfe8c19ed8274811..f4dcba21d620040bfc65947a989fe6e407ffd664 100644 (file)
@@ -201,6 +201,7 @@ ifeq ($(do_tools_hyperv),true)
        dh_installinit -p$(cloudpkg) -n --name hv-vss-daemon
        dh_installinit -p$(cloudpkg) -n --name hv-fcopy-daemon
        dh_installudev -p$(cloudpkg) -n --name hv-kvp-daemon
+       dh_installudev -p$(cloudpkg) -n --name hv-vss-daemon
        dh_systemd_enable -p$(cloudpkg)
        dh_installinit -p$(cloudpkg) -o --name hv-kvp-daemon
        dh_installinit -p$(cloudpkg) -o --name hv-vss-daemon