From: Mike Yuan Date: Mon, 6 Oct 2025 20:19:36 +0000 (+0200) Subject: mute-console: if muting is disabled, suppress "not restoring" messages X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=39305cf9744033868c1784c719b018a0cbd7729e;p=thirdparty%2Fsystemd.git mute-console: if muting is disabled, suppress "not restoring" messages --- diff --git a/src/mute-console/mute-console.c b/src/mute-console/mute-console.c index a5bb4cce61a..680e15296e8 100644 --- a/src/mute-console/mute-console.c +++ b/src/mute-console/mute-console.c @@ -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; }