dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
df98bb
From 4dc498258bd0cce1bc8ad2311c5f12de5678e0af Mon Sep 17 00:00:00 2001
df98bb
From: Jan Macku <jamacku@redhat.com>
df98bb
Date: Thu, 27 May 2021 12:25:51 +0200
df98bb
Subject: [PATCH] core: Hide "Deactivated successfully" message
df98bb
df98bb
Show message "Deactivated successfully" in debug mode (when manager is
df98bb
user) rather than in info mode. This message has low information value
df98bb
for regular users and it might be a bit overwhelming on a system with
df98bb
a lot of devices.
df98bb
df98bb
(cherry picked from commit edf2ee22f54005d76b2fb8fdcc9c60974feb88bc)
df98bb
df98bb
Resolves: #1954802
df98bb
---
df98bb
 src/core/unit.c | 5 ++++-
df98bb
 1 file changed, 4 insertions(+), 1 deletion(-)
df98bb
df98bb
diff --git a/src/core/unit.c b/src/core/unit.c
df98bb
index cd3e7c806d..93c13e58d9 100644
df98bb
--- a/src/core/unit.c
df98bb
+++ b/src/core/unit.c
df98bb
@@ -5525,7 +5525,10 @@ int unit_pid_attachable(Unit *u, pid_t pid, sd_bus_error *error) {
df98bb
 void unit_log_success(Unit *u) {
df98bb
         assert(u);
df98bb
 
df98bb
-        log_struct(LOG_INFO,
df98bb
+        /* Let's show message "Deactivated successfully" in debug mode (when manager is user) rather than in info mode.
df98bb
+         * This message has low information value for regular users and it might be a bit overwhelming on a system with
df98bb
+         * a lot of devices. */
df98bb
+        log_struct(MANAGER_IS_USER(u->manager) ? LOG_DEBUG : LOG_INFO,
df98bb
                    "MESSAGE_ID=" SD_MESSAGE_UNIT_SUCCESS_STR,
df98bb
                    LOG_UNIT_ID(u),
df98bb
                    LOG_UNIT_INVOCATION_ID(u),