How can I find failed systemd services?
Solution 1:
Try
sudo systemctl list-units --failed
or
sudo systemctl list-units --state=failed
Solution 2:
It seems like is-failed
is the wrong sub command… who would have guessed.
here is some perl hackery to get the right answer:
$ systemctl list-units | perl -lanE'print if $F[2] !~ /active/'
UNIT LOAD ACTIVE SUB DESCRIPTION
● vboxautostart-service.service loaded failed failed vboxautostart-service.service
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
207 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
And systemctl
is also that nice to clutter stderr with informational output in a way that we only get the output we want.