This is the strongest relationship that can be declared between
two units, and causes the service to be terminated immediately
if its main socket disappears. This is the behavior we want.
Note that we don't do the same for the read-only/admin sockets,
because those are not as critical for the core functionality of
services as the main socket it.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/locking/virtlockd.service.in | 3 ++-
src/logging/virtlogd.service.in | 3 ++-
src/virtd.service.in | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
index 9e91fa3261..35924a2ad7 100644
--- a/src/locking/virtlockd.service.in
+++ b/src/locking/virtlockd.service.in
@@ -1,7 +1,8 @@
[Unit]
Description=Virtual machine lock manager
-Requires=virtlockd.socket
+BindsTo=virtlockd.socket
Requires=virtlockd-admin.socket
+After=virtlockd.socket
Before=libvirtd.service
Documentation=man:virtlockd(8)
Documentation=https://libvirt.org
diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in
index 97c942ffb0..79d34bc73e 100644
--- a/src/logging/virtlogd.service.in
+++ b/src/logging/virtlogd.service.in
@@ -1,7 +1,8 @@
[Unit]
Description=Virtual machine log manager
-Requires=virtlogd.socket
+BindsTo=virtlogd.socket
Requires=virtlogd-admin.socket
+After=virtlogd.socket
Before=libvirtd.service
Documentation=man:virtlogd(8)
Documentation=https://libvirt.org
diff --git a/src/virtd.service.in b/src/virtd.service.in
index 60ab122cbc..e7f08b4da9 100644
--- a/src/virtd.service.in
+++ b/src/virtd.service.in
@@ -1,8 +1,9 @@
[Unit]
Description=@name@ daemon
-Requires=@service@.socket
+BindsTo=@service@.socket
Requires=@service(a)-ro.socket
Requires=@service(a)-admin.socket
+After=@service@.socket
Conflicts=libvirtd.service
After=libvirtd.service
After=network.target
--
2.41.0