I have a complex systemd target unit with a number of dependency units. I would like to list and parse the status of these without falling back to a loop.
the 'list-dependencies' sub-command only gives the status in form of a (coloured, not reproduced in plain unicode) dot, that is not really good to parse.
> systemctl list-dependencies --no-page myunit.target
dcache.target
● ├─mytemplate@unit_foo.service
● ├─mytemplate@unit_bar.service
● ├─mytemplate@unit_baz.service
...
the --no-page flag seems to have no affect and the output stays the same with/without.
Alternatively,
systemctl list-dependencies --plain myunit.target
only list the dependencies but without their current status
Is there a way to generate output from 'systemctl list-dependencies', that can be parsed or is in JSON or similar?