Blob Blame History Raw
From 8d8d64b5a542e9530dc0e06e7bd4e6f47aee56e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 27 Dec 2013 22:12:38 -0500
Subject: [PATCH] core/manager: print info about interesting signals

Information about signals which are not routinely received by systemd
are printed at info level. This should make it easier to see what is
happening in the system.

(cherry picked from commit a9244623f785f504f799407b0228dea9655e24cb)
---
 src/core/manager.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/core/manager.c b/src/core/manager.c
index a34a3c6..69ad4b5 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1435,16 +1435,22 @@ static int manager_process_signal_fd(Manager *m) {
                 }
 
                 if (sfsi.ssi_pid > 0) {
-                        char *p = NULL;
+                        _cleanup_free_ char *p = NULL;
 
                         get_process_comm(sfsi.ssi_pid, &p);
 
-                        log_debug("Received SIG%s from PID %lu (%s).",
-                                  signal_to_string(sfsi.ssi_signo),
-                                  (unsigned long) sfsi.ssi_pid, strna(p));
-                        free(p);
+                        log_full(sfsi.ssi_signo == SIGCHLD ||
+                                 (sfsi.ssi_signo == SIGTERM && m->running_as == SYSTEMD_USER)
+                                 ? LOG_DEBUG : LOG_INFO,
+                                 "Received SIG%s from PID %lu (%s).",
+                                 signal_to_string(sfsi.ssi_signo),
+                                 (unsigned long) sfsi.ssi_pid, strna(p));
                 } else
-                        log_debug("Received SIG%s.", signal_to_string(sfsi.ssi_signo));
+                        log_full(sfsi.ssi_signo == SIGCHLD ||
+                                 (sfsi.ssi_signo == SIGTERM && m->running_as == SYSTEMD_USER)
+                                 ? LOG_DEBUG : LOG_INFO,
+                                 "Received SIG%s.",
+                                 signal_to_string(sfsi.ssi_signo));
 
                 switch (sfsi.ssi_signo) {