Blob Blame History Raw
From 778f7c61b8d55e0b8d8eccd2cf8649d730e7d4a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Tue, 3 Apr 2018 21:43:28 +0200
Subject: [PATCH] SERVER: Tone down shutdown messages for socket-activated
 responders
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When dealing with socket-activated responders, those may be shut
themselves down after some inactivy period. And that's completely normal
and expected, thus should not be logged as an fatal error.

For the case when the responder is started by the monitor, however, it
still makes sense to keep the code as it is as the responders won't shut
themselves down in any normal scenario.

Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit 519354d079731e673244a8e3851e5c5522d1b45e)
---
 src/util/server.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/util/server.c b/src/util/server.c
index 62e09314c..f34bf49f6 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -248,8 +248,12 @@ void orderly_shutdown(int status)
 {
 #if HAVE_GETPGRP
     static int sent_sigterm;
+    int debug;
+
     if (sent_sigterm == 0 && getpgrp() == getpid()) {
-        DEBUG(SSSDBG_FATAL_FAILURE, "SIGTERM: killing children\n");
+        debug = is_socket_activated() ? SSSDBG_TRACE_INTERNAL
+                                      : SSSDBG_FATAL_FAILURE;
+        DEBUG(debug, "SIGTERM: killing children\n");
         sent_sigterm = 1;
         kill(-getpgrp(), SIGTERM);
     }
-- 
2.14.3