4 ms·
> not being able to format output of "list-units" for easy machine readability are close seconds. Seems like 'systemctl -o json list-units' might be what you w
by rascul 2y ago
> not being able to format output of "list-units" for easy machine readability are close seconds.
Seems like 'systemctl -o json list-units' might be what you want.
- blueflow 2y agoAs of systemd 252, this is undocumented functionality. -o is only specified for systemctl status.
- rascul 2y agoI noticed that, tried it anyway, and it worked. Would probably be helpful if it was properly documented.
- bayindirh 2y agoWhile it's noted that it's undocumented behavior (-o is non-existent in systemctl man page), so it might go away tomorrow, it's not a bad start. However what I want is more like systemctl -o json list-units --type=service --state=active I can add --terse for single line output to prevent adding jq to the pipe for processing that JSON. Maybe instead of writing a bit better code and actually documenting these options, they can just absorb jq as jsonctl, who knows. Sorry, I kinda get angry when I encounter shenanigans like undocumented functionality, or hostile-replacing a daemon because they felt like replacing something really working well for the last 20ish years, just for fun, you know.