c11cae
From 601fbd22bbf812cb0ef60b039fc8214dadbdffaa Mon Sep 17 00:00:00 2001
c11cae
Message-Id: <601fbd22bbf812cb0ef60b039fc8214dadbdffaa@dist-git>
c11cae
From: Martin Kletzander <mkletzan@redhat.com>
c11cae
Date: Tue, 1 May 2018 15:54:22 +0200
c11cae
Subject: [PATCH] logging: Don't inhibit shutdown in system daemon
c11cae
MIME-Version: 1.0
c11cae
Content-Type: text/plain; charset=UTF-8
c11cae
Content-Transfer-Encoding: 8bit
c11cae
c11cae
That is a job of libvirtd and virtlogd has a dependency on it, so that will
c11cae
prevent it properly.  Doing it one extra time in virtlogd might also cause AVC
c11cae
denials because it is not allowed to call that dbus method.
c11cae
c11cae
Caused by commit df34363d58bb.
c11cae
c11cae
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1547250
c11cae
c11cae
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
c11cae
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
c11cae
(cherry picked from commit f94e5b215720c91c60219f1694783a603f0b619c)
c11cae
c11cae
https: //bugzilla.redhat.com/show_bug.cgi?id=1573268
c11cae
Reviewed-by: Erik Skultety <eskultet@redhat.com>
c11cae
---
c11cae
 src/logging/log_daemon.c | 6 ++++++
c11cae
 1 file changed, 6 insertions(+)
c11cae
c11cae
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
c11cae
index 5a136c59d1..b00b37878a 100644
c11cae
--- a/src/logging/log_daemon.c
c11cae
+++ b/src/logging/log_daemon.c
c11cae
@@ -129,6 +129,12 @@ virLogDaemonInhibitor(bool inhibit, void *opaque)
c11cae
 {
c11cae
     virLogDaemonPtr dmn = opaque;
c11cae
 
c11cae
+    /* virtlogd uses inhibition only to stop session daemon being killed after
c11cae
+     * the specified timeout, for the system daemon this is taken care of by
c11cae
+     * libvirtd and the dependencies between the services. */
c11cae
+    if (virNetDaemonIsPrivileged(dmn->dmn))
c11cae
+        return;
c11cae
+
c11cae
     if (inhibit)
c11cae
         virNetDaemonAddShutdownInhibition(dmn->dmn);
c11cae
     else
c11cae
-- 
c11cae
2.17.1
c11cae