]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mute-console: if muting is disabled, suppress "not restoring" messages
authorMike Yuan <me@yhndnzj.com>
Mon, 6 Oct 2025 20:19:36 +0000 (22:19 +0200)
committerMike Yuan <me@yhndnzj.com>
Tue, 7 Oct 2025 11:38:21 +0000 (13:38 +0200)
src/mute-console/mute-console.c

index a5bb4cce61a718ee2d5717a30f9a275c5f6297f3..680e15296e825f18ac9a7227a100a97ce41681cb 100644 (file)
@@ -167,7 +167,8 @@ static int unmute_pid1(Context *c) {
         assert(c);
 
         if (!c->muted_pid1) {
-                log_debug("Not restoring PID 1 status console output level.");
+                if (c->mute_pid1)
+                        log_debug("Not restoring PID 1 status console output level.");
                 return 0;
         }
 
@@ -193,6 +194,8 @@ static int mute_kernel(Context *c) {
 
         if (detect_container() > 0) {
                 log_debug("Skipping muting of printk() console output, because running in a container.");
+
+                c->mute_kernel = false;
                 c->saved_kernel = -1;
                 return 0;
         }
@@ -222,7 +225,8 @@ static int unmute_kernel(Context *c) {
         assert(c);
 
         if (c->saved_kernel < 0) {
-                log_debug("Not restoring kernel printk() console output level.");
+                if (c->mute_kernel)
+                        log_debug("Not restoring kernel printk() console output level.");
                 return 0;
         }