[PATCH 1/4] virtlogd.socket: Tie lifecycle to libvirtd.service

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We already guarantee that virtlogd.socket is enabled/disabled
along with libvirtd.service, but if libvirtd.service has just
been installed and is started before rebooting, then
virtlogd.socket will not be running and guest startup will
fail.

Add Requires=virtlogd.socket to libvirtd.service to make sure
virtlogd.socket is always started along with libvirtd.service,
and add Before=libvirtd.service to both virtlogd.socket and
virtlogd.service so that virtlogd never disappears before
libvirtd has exited.

Also add PartOf=libvirtd.service to both virtlogd.socket and
virtlogd.service, so that virtlogd can be shut down when not
needed.

Resolves: https://bugzilla.redhat.com/1372576
---
 daemon/libvirtd.service.in      | 1 +
 src/logging/virtlogd.service.in | 2 ++
 src/logging/virtlogd.socket.in  | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in
index 1616e7a..bbf27da 100644
--- a/daemon/libvirtd.service.in
+++ b/daemon/libvirtd.service.in
@@ -5,6 +5,7 @@
 
 [Unit]
 Description=Virtualization daemon
+Requires=virtlogd.socket
 Before=libvirt-guests.service
 After=network.target
 After=dbus.service
diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in
index a264d3a..8287994 100644
--- a/src/logging/virtlogd.service.in
+++ b/src/logging/virtlogd.service.in
@@ -1,6 +1,8 @@
 [Unit]
 Description=Virtual machine log manager
 Requires=virtlogd.socket
+Before=libvirtd.service
+PartOf=libvirtd.service
 Documentation=man:virtlogd(8)
 Documentation=http://libvirt.org
 
diff --git a/src/logging/virtlogd.socket.in b/src/logging/virtlogd.socket.in
index 724976d..efb6504 100644
--- a/src/logging/virtlogd.socket.in
+++ b/src/logging/virtlogd.socket.in
@@ -1,5 +1,7 @@
 [Unit]
 Description=Virtual machine log manager socket
+Before=libvirtd.service
+PartOf=libvirtd.service
 
 [Socket]
 ListenStream=@localstatedir@/run/libvirt/virtlogd-sock
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]