ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
Blob Blame History Raw
From 09fcc5cffa54468595fbf6b81308cd22e896cdfe Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 17 Jun 2014 01:05:39 +0200
Subject: [PATCH] log: don't downgrade log level in non-PID 1 if "quiet" is
 passed on kernel cmdline

"debug" should apply to all tools, but "quiet" only to PID1.

(cherry picked from commit d7b15e0a0161e8fd823bffd61a4799364871582f)
---
 src/core/main.c  | 5 +++++
 src/shared/log.c | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/core/main.c b/src/core/main.c
index c9472929..80a2ea3a 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -412,11 +412,16 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 }
 
         } else if (streq(key, "quiet") && !value) {
+
+                log_set_max_level(LOG_NOTICE);
+
                 if (arg_show_status == _SHOW_STATUS_UNSET)
                         arg_show_status = SHOW_STATUS_AUTO;
 
         } else if (streq(key, "debug") && !value) {
+
                 log_set_max_level(LOG_DEBUG);
+
                 if (detect_container(NULL) > 0)
                         log_set_target(LOG_TARGET_CONSOLE);
 
diff --git a/src/shared/log.c b/src/shared/log.c
index 6f17705a..9039db34 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -878,9 +878,6 @@ void log_parse_environment(void) {
                         if (l == 5 && startswith(w, "debug")) {
                                 log_set_max_level(LOG_DEBUG);
                                 break;
-                        } else if (l == 5 && startswith(w, "quiet")) {
-                                log_set_max_level(LOG_WARNING);
-                                break;
                         }
                 }
         }