]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: fix status output suppression
authorLennart Poettering <lennart@poettering.net>
Fri, 19 Sep 2025 08:13:45 +0000 (10:13 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 13 Oct 2025 14:59:40 +0000 (16:59 +0200)
This fixes two things: first of all it ensures we take the override
status output field properly into account, instead of going directly to
the regular one.

Moreover, it ensures that we bypass auto for both notice + emergency,
since both have the same "impact", and, don't limit this for notice
only.

(cherry picked from commit 9ecc969855ce7d8e587ea2ea0b6c3120877a7887)

src/core/manager.c
src/core/unit.h

index 11903c2c5db6ea6414fe55e51707fa9439539cb4..20a535f2f43eba37a766dd3a61403d0acf59574c 100644 (file)
@@ -4522,10 +4522,10 @@ static bool manager_should_show_status(Manager *m, StatusType type) {
                 return false;
 
         /* If we cannot find out the status properly, just proceed. */
-        if (type != STATUS_TYPE_EMERGENCY && manager_check_ask_password(m) > 0)
+        if (type < STATUS_TYPE_EMERGENCY && manager_check_ask_password(m) > 0)
                 return false;
 
-        if (type == STATUS_TYPE_NOTICE && m->show_status != SHOW_STATUS_NO)
+        if (type >= STATUS_TYPE_NOTICE && manager_get_show_status(m) != SHOW_STATUS_NO)
                 return true;
 
         return manager_get_show_status_on(m);
index 62652540bc008c56d5f7cb1501e75760646da40a..9b7d00da10080104056f7a8fe45be74e614e9448 100644 (file)
@@ -52,10 +52,12 @@ typedef enum OOMPolicy {
 } OOMPolicy;
 
 typedef enum StatusType {
-        STATUS_TYPE_EPHEMERAL,
+        STATUS_TYPE_EPHEMERAL,   /* ordered by severity! Do not break order */
         STATUS_TYPE_NORMAL,
         STATUS_TYPE_NOTICE,
         STATUS_TYPE_EMERGENCY,
+        _STATUS_TYPE_MAX,
+        _STATUS_TYPE_INVALID = -EINVAL,
 } StatusType;
 
 static inline bool UNIT_IS_ACTIVE_OR_RELOADING(UnitActiveState t) {