Requires/Wants only tells systemd that the corresponding unit
should be started when the current one is, but that could very
well happen in parallel. For virtlogd/virtlockd, we want the
socket to be already active when the hypervisor driver is
started.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/libxl/virtxend.service.extra.in | 1 +
src/locking/virtlockd.service.in | 1 +
src/logging/virtlogd.service.in | 1 +
src/qemu/virtqemud.service.extra.in | 2 ++
src/remote/libvirtd.service.in | 7 ++++++-
src/virtd.service.in | 2 ++
6 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/libxl/virtxend.service.extra.in b/src/libxl/virtxend.service.extra.in
index ba38ba9160..55783aa3d5 100644
--- a/src/libxl/virtxend.service.extra.in
+++ b/src/libxl/virtxend.service.extra.in
@@ -1,5 +1,6 @@
[Unit]
Wants=virtlockd.socket
+After=virtlockd.socket
After=remote-fs.target
After=xencommons.service
Conflicts=xendomains.service
diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
index fcf479c3c6..e0a7040ad3 100644
--- a/src/locking/virtlockd.service.in
+++ b/src/locking/virtlockd.service.in
@@ -3,6 +3,7 @@ Description=Virtual machine lock manager
BindsTo=virtlockd.socket
Wants=virtlockd-admin.socket
After=virtlockd.socket
+After=virtlockd-admin.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 3265ecd6af..eab0d2c27c 100644
--- a/src/logging/virtlogd.service.in
+++ b/src/logging/virtlogd.service.in
@@ -3,6 +3,7 @@ Description=Virtual machine log manager
BindsTo=virtlogd.socket
Wants=virtlogd-admin.socket
After=virtlogd.socket
+After=virtlogd-admin.socket
Before=libvirtd.service
Documentation=man:virtlogd(8)
Documentation=https://libvirt.org
diff --git a/src/qemu/virtqemud.service.extra.in b/src/qemu/virtqemud.service.extra.in
index eaf616f575..585e1e82eb 100644
--- a/src/qemu/virtqemud.service.extra.in
+++ b/src/qemu/virtqemud.service.extra.in
@@ -1,6 +1,8 @@
[Unit]
Requires=virtlogd.socket
Wants=virtlockd.socket
+After=virtlogd.socket
+After=virtlockd.socket
Wants=systemd-machined.service
After=systemd-machined.service
After=remote-fs.target
diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
index 8839c00a15..a2c3c8f8fa 100644
--- a/src/remote/libvirtd.service.in
+++ b/src/remote/libvirtd.service.in
@@ -1,13 +1,18 @@
[Unit]
Description=Virtualization daemon
-Requires=virtlogd.socket
# Use Wants instead of Requires so that users
# can disable these three .socket units to revert
# to a traditional non-activation deployment setup
Wants=libvirtd.socket
Wants=libvirtd-ro.socket
Wants=libvirtd-admin.socket
+After=libvirtd.socket
+After=libvirtd-ro.socket
+After=libvirtd-admin.socket
+Requires=virtlogd.socket
Wants=virtlockd.socket
+After=virtlogd.socket
+After=virtlockd.socket
Wants=systemd-machined.service
After=network.target
After=dbus.service
diff --git a/src/virtd.service.in b/src/virtd.service.in
index f4f1bc217d..e1a5814b13 100644
--- a/src/virtd.service.in
+++ b/src/virtd.service.in
@@ -4,6 +4,8 @@ BindsTo=@service@.socket
Wants=@service(a)-ro.socket
Wants=@service(a)-admin.socket
After=@service@.socket
+After=@service(a)-ro.socket
+After=@service(a)-admin.socket
Conflicts=libvirtd.service
After=libvirtd.service
After=network.target
--
2.41.0