]> git.ipfire.org Git - thirdparty/systemd.git/commit
systemctl: list-jobs: interchange 'waiting for' and 'blocking' in output
authorRasmus Villemoes <rv@rasmusvillemoes.dk>
Wed, 24 Apr 2024 09:16:50 +0000 (11:16 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 24 Apr 2024 19:31:28 +0000 (21:31 +0200)
commitdc3058e4901cc26a833da981a18a85563f0d4409
tree2677234f1823d2c71f326eccadd180a5c1f364e7
parentcea14db9147a4f23392036d77d779a76a42ed783
systemctl: list-jobs: interchange 'waiting for' and 'blocking' in output

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