aboutsummaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
authorBastian Blank <bastian.blank@credativ.de>2020-07-31 13:52:05 +0200
committerBastian Blank <waldi@debian.org>2020-07-31 21:42:15 +0200
commit2306e64860020bc60d8c269aeaacd61f97327088 (patch)
treee984c809d5fb7a1842eeff6307f8af20d6dbf15e /debian
parenta8f915f7521ebe9880b3a0131d671ab3f46ac205 (diff)
downloadkernel_replicant_linux-2306e64860020bc60d8c269aeaacd61f97327088.tar.gz
kernel_replicant_linux-2306e64860020bc60d8c269aeaacd61f97327088.tar.bz2
kernel_replicant_linux-2306e64860020bc60d8c269aeaacd61f97327088.zip
[x86] hyperv-daemons: Make systemd service bind to device
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog4
-rw-r--r--debian/hyperv-daemons.hv-fcopy-daemon.service2
-rw-r--r--debian/hyperv-daemons.hv-kvp-daemon.service2
-rw-r--r--debian/hyperv-daemons.hv-vss-daemon.service2
-rwxr-xr-xdebian/hyperv-daemons.postinst18
-rw-r--r--debian/hyperv-daemons.udev3
-rw-r--r--debian/rules.real3
7 files changed, 29 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 02cfd9d8f5e7..ec46a58a79f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -46,7 +46,9 @@ linux (5.8~rc7-1~exp1) UNRELEASED; urgency=medium
* Set ABI to trunk
[ Bastian Blank ]
- * [x86] hyperv-daemons: Use debhelper for services.
+ * [x86] hyperv-daemons:
+ - Use debhelper for services.
+ - Make systemd service bind to device.
-- Yves-Alexis Perez <corsac@debian.org> Wed, 24 Jun 2020 21:58:24 +0200
diff --git a/debian/hyperv-daemons.hv-fcopy-daemon.service b/debian/hyperv-daemons.hv-fcopy-daemon.service
index 1154e6f91d6a..8a2a02c5f9bb 100644
--- a/debian/hyperv-daemons.hv-fcopy-daemon.service
+++ b/debian/hyperv-daemons.hv-fcopy-daemon.service
@@ -1,7 +1,7 @@
[Unit]
Description=Hyper-V file copy service (FCOPY) daemon
-ConditionPathExists=/dev/vmbus/hv_fcopy
Conflicts=hyperv-daemon.hv-fcopy-daemon.service
+BindsTo=sys-devices-virtual-misc-vmbus\x21hv_fcopy.device
[Service]
ExecStart=/usr/sbin/hv_fcopy_daemon -n
diff --git a/debian/hyperv-daemons.hv-kvp-daemon.service b/debian/hyperv-daemons.hv-kvp-daemon.service
index 04a108d8375b..594e6fd5a178 100644
--- a/debian/hyperv-daemons.hv-kvp-daemon.service
+++ b/debian/hyperv-daemons.hv-kvp-daemon.service
@@ -1,7 +1,7 @@
[Unit]
Description=Hyper-V key-value pair (KVP) daemon
-ConditionPathExists=/dev/vmbus/hv_kvp
Conflicts=hyperv-daemon.hv-kvp-daemon.service
+BindsTo=sys-devices-virtual-misc-vmbus\x21hv_kvp.device
[Service]
ExecStart=/usr/sbin/hv_kvp_daemon -n
diff --git a/debian/hyperv-daemons.hv-vss-daemon.service b/debian/hyperv-daemons.hv-vss-daemon.service
index 0216576478d4..933857e4a718 100644
--- a/debian/hyperv-daemons.hv-vss-daemon.service
+++ b/debian/hyperv-daemons.hv-vss-daemon.service
@@ -1,7 +1,7 @@
[Unit]
Description=Hyper-V volume shadow copy service (VSS) daemon
-ConditionPathExists=/dev/vmbus/hv_vss
Conflicts=hyperv-daemon.hv-vss-daemon.service
+BindsTo=sys-devices-virtual-misc-vmbus\x21hv_vss.device
[Service]
ExecStart=/usr/sbin/hv_vss_daemon -n
diff --git a/debian/hyperv-daemons.postinst b/debian/hyperv-daemons.postinst
new file mode 100755
index 000000000000..3573c9c2edba
--- /dev/null
+++ b/debian/hyperv-daemons.postinst
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "configure" ]; then
+ if [ -d /run/systemd/system ]; then
+ if [ -z "$2" ]; then
+ # On initial install make sure udev notifies systemd
+ udevadm trigger || true
+ else
+ # On upgrade make sure running daemons are restarted
+ systemctl try-restart hv-fcopy-daemon.service hv-kvp-daemon.service hv-vss-daemon.service
+ fi
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/hyperv-daemons.udev b/debian/hyperv-daemons.udev
new file mode 100644
index 000000000000..1daacac696bc
--- /dev/null
+++ b/debian/hyperv-daemons.udev
@@ -0,0 +1,3 @@
+KERNEL=="vmbus/hv_fcopy", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv-fcopy-daemon.service"
+KERNEL=="vmbus/hv_kvp", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv-kvp-daemon.service"
+KERNEL=="vmbus/hv_vss", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv-vss-daemon.service"
diff --git a/debian/rules.real b/debian/rules.real
index 875c3d8a0e95..0820bcaa6a0f 100644
--- a/debian/rules.real
+++ b/debian/rules.real
@@ -770,11 +770,12 @@ ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
dh_installdocs
endif
for service in fcopy kvp vss; do \
- dh_installsystemd --name hv-$$service-daemon \
+ dh_installsystemd --name hv-$$service-daemon --no-enable --no-start \
|| break; \
dh_installinit --name hv-$$service-daemon \
|| break; \
done
+ dh_installudev
dh_lintian
dh_strip
dh_compress