diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-06-11 14:37:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-11 14:37:10 +0200 |
commit | bbac65bcc20377cd22c005874bd95724bad6d66e (patch) | |
tree | 379aacf1ab500c5bc382cbd7a9b58c68fc0418f8 /src/systemctl | |
parent | 8d00da49fbb4f8b1ac2c7ccb0405e0011c2ce5c8 (diff) | |
parent | 6f40aa4547ac2c62ade78268108a4fa60b6e9fff (diff) | |
download | systemd-bbac65bcc20377cd22c005874bd95724bad6d66e.tar.gz |
Merge pull request #9157 from poettering/unit-config-load-error
introduce a new "bad-setting" unit load state in order to improve "systemctl status" output when bad settings are used
Diffstat (limited to 'src/systemctl')
-rw-r--r-- | src/systemctl/systemctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 9e6d13a400..c9d2912e13 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -416,7 +416,7 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) { if (!arg_no_legend && (streq(u->active_state, "failed") || - STR_IN_SET(u->load_state, "error", "not-found", "masked"))) + STR_IN_SET(u->load_state, "error", "not-found", "bad-setting", "masked"))) circle_len = 2; } @@ -493,7 +493,7 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) { underline = true; } - if (STR_IN_SET(u->load_state, "error", "not-found", "masked") && !arg_plain) { + if (STR_IN_SET(u->load_state, "error", "not-found", "bad-setting", "masked") && !arg_plain) { on_circle = ansi_highlight_yellow(); off_circle = ansi_normal(); circle = true; @@ -3979,7 +3979,7 @@ static void print_status_info( if (i->following) printf(" Follow: unit currently follows state of %s\n", i->following); - if (streq_ptr(i->load_state, "error")) { + if (STRPTR_IN_SET(i->load_state, "error", "not-found", "bad-setting")) { on = ansi_highlight_red(); off = ansi_normal(); } else @@ -3989,7 +3989,7 @@ static void print_status_info( if (path && terminal_urlify_path(path, NULL, &formatted_path) >= 0) path = formatted_path; - if (i->load_error != 0) + if (!isempty(i->load_error)) printf(" Loaded: %s%s%s (Reason: %s)\n", on, strna(i->load_state), off, i->load_error); else if (path && !isempty(i->unit_file_state) && !isempty(i->unit_file_preset) && |