]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: suppress one debugging log
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 7 Oct 2024 21:19:04 +0000 (06:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Oct 2024 20:36:11 +0000 (05:36 +0900)
Otherwise, the log is shown even when getting properties.
Even though it is in the debug level, that's quite noisy.

[  338.785847] TEST-55-OOMD.sh[1624]: Oct 07 16:35:15 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.786985] TEST-55-OOMD.sh[1624]: Oct 07 16:35:17 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.787412] TEST-55-OOMD.sh[1624]: Oct 07 16:35:20 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.791776] TEST-55-OOMD.sh[1624]: Oct 07 16:35:22 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.792938] TEST-55-OOMD.sh[1624]: Oct 07 16:35:24 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.793225] TEST-55-OOMD.sh[1624]: Oct 07 16:35:26 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.793424] TEST-55-OOMD.sh[1624]: Oct 07 16:35:28 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.796448] TEST-55-OOMD.sh[1624]: Oct 07 16:35:31 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.797997] TEST-55-OOMD.sh[1624]: Oct 07 16:35:33 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.799206] TEST-55-OOMD.sh[1624]: Oct 07 16:35:35 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount

src/core/service.c

index 7162016313c18678b1cc66643b3a596189fd75db..c008849b7863fb5633e0fd86b627f189584226d6 100644 (file)
@@ -5309,7 +5309,11 @@ static int service_can_live_mount(const Unit *u, sd_bus_error *error) {
 
         /* Ensure that the unit runs in a private mount namespace */
         if (!exec_needs_mount_namespace(unit_get_exec_context(u), /* params= */ NULL, unit_get_exec_runtime(u))) {
-                log_unit_debug(u, "Unit not running in private mount namespace, cannot live mount");
+
+                /* This is also called in property_get_can_live_mount(). Suppress the debugging log when called in it. */
+                if (error)
+                        log_unit_debug(u, "Unit not running in private mount namespace, cannot live mount");
+
                 return sd_bus_error_setf(
                                 error,
                                 SD_BUS_ERROR_INVALID_ARGS,