From dc3058e4901cc26a833da981a18a85563f0d4409 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Wed, 24 Apr 2024 11:16:50 +0200 Subject: [PATCH] systemctl: list-jobs: interchange 'waiting for' and 'blocking' in output MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The current output of 'systemctl list-jobs' with the --after and/or --before switches seems backwards. With artificial units # check-oil.service [Unit] Description=Check the oil level Before=engine-ready.target # fill-gas.service [Unit] Description=Fill the tank with gasoline Before=engine-ready.target # engine-ready.target [Unit] Description=The engine is ready [Unit] Description=Start the engine! After=engine-ready.target Wants=engine-ready.target running 'systemctl list-jobs --before --after' produces JOB UNIT TYPE STATE 93 check-oil.service start running └─ waiting for job 94 (engine-ready.target/start) - - 102 fill-gas.service start running └─ waiting for job 94 (engine-ready.target/start) - - 94 engine-ready.target start waiting └─ waiting for job 111 (start-engine.service/start) - - └─ blocking job 93 (check-oil.service/start) - - └─ blocking job 102 (fill-gas.service/start) - - 111 start-engine.service start waiting └─ waiting for job 1 (multi-user.target/start) - - └─ blocking job 94 (engine-ready.target/start) - - Obviously, job 93 is not waiting for job 94, but rather blocking it. --- src/systemctl/systemctl-list-jobs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/systemctl/systemctl-list-jobs.c b/src/systemctl/systemctl-list-jobs.c index a752173e4e..fcfe2ac561 100644 --- a/src/systemctl/systemctl-list-jobs.c +++ b/src/systemctl/systemctl-list-jobs.c @@ -102,9 +102,9 @@ static int output_jobs_list(sd_bus *bus, const struct job_info* jobs, unsigned n return table_log_add_error(r); if (arg_jobs_after) - output_waiting_jobs(bus, table, j->id, "GetJobAfter", "\twaiting for job"); + output_waiting_jobs(bus, table, j->id, "GetJobAfter", "\tblocking job"); if (arg_jobs_before) - output_waiting_jobs(bus, table, j->id, "GetJobBefore", "\tblocking job"); + output_waiting_jobs(bus, table, j->id, "GetJobBefore", "\twaiting for job"); } r = table_print(table, NULL); -- 2.25.1