[{bionic, xenial}:linux PATCH 1/1] UBUNTU: [Packaging] bind hv_kvp_daemon startup to hv_kvp device

Marcelo Henrique Cerri marcelo.cerri at canonical.com
Wed Dec 11 14:35:09 UTC 2019


From: Seth Forshee <seth.forshee at canonical.com>

BugLink: https://bugs.launchpad.net/bugs/1820063

The hv_kvp_daemon service requires the hv_kvp device and should
be started when the device appears and stopped in it disappears.
Solution is based off the one provided at
https://bugzilla.redhat.com/show_bug.cgi?id=1195029#c22.

Signed-off-by: Seth Forshee <seth.forshee at canonical.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri at canonical.com>
---
 debian/linux-cloud-tools-common.hv-kvp-daemon.service | 3 ++-
 debian/linux-cloud-tools-common.hv-kvp-daemon.udev    | 1 +
 debian/rules.d/3-binary-indep.mk                      | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 debian/linux-cloud-tools-common.hv-kvp-daemon.udev

diff --git a/debian/linux-cloud-tools-common.hv-kvp-daemon.service b/debian/linux-cloud-tools-common.hv-kvp-daemon.service
index 015c96f9fea7..571440344cb5 100644
--- a/debian/linux-cloud-tools-common.hv-kvp-daemon.service
+++ b/debian/linux-cloud-tools-common.hv-kvp-daemon.service
@@ -5,7 +5,8 @@
 Description=Hyper-V KVP Protocol Daemon
 ConditionVirtualization=microsoft
 DefaultDependencies=no
-After=systemd-remount-fs.service
+BindsTo=sys-devices-virtual-misc-vmbus\x21hv_kvp.device
+After=sys-devices-virtual-misc-vmbus\x21hv_kvp.device systemd-remount-fs.service
 Before=shutdown.target cloud-init-local.service walinuxagent.service
 Conflicts=shutdown.target
 RequiresMountsFor=/var/lib/hyperv
diff --git a/debian/linux-cloud-tools-common.hv-kvp-daemon.udev b/debian/linux-cloud-tools-common.hv-kvp-daemon.udev
new file mode 100644
index 000000000000..0c648f54d4c4
--- /dev/null
+++ b/debian/linux-cloud-tools-common.hv-kvp-daemon.udev
@@ -0,0 +1 @@
+SUBSYSTEM=="misc", KERNEL=="vmbus/hv_kvp", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv-kvp-daemon.service"
diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk
index b27275685612..6c847da42bd4 100644
--- a/debian/rules.d/3-binary-indep.mk
+++ b/debian/rules.d/3-binary-indep.mk
@@ -190,6 +190,7 @@ ifeq ($(do_tools_hyperv),true)
 	dh_installinit -p$(cloudpkg) -n --name hv-kvp-daemon
 	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_systemd_enable -p$(cloudpkg)
 	dh_installinit -p$(cloudpkg) -o --name hv-kvp-daemon
 	dh_installinit -p$(cloudpkg) -o --name hv-vss-daemon
-- 
2.20.1




More information about the kernel-team mailing list