Show all systemd services which are enabled, but not running

systemd

How can I show all systemd services which are enabled, but not running?

AFAIK "not running" can happen in two cases:

  1. the service has crashed
  2. the serivce was stopped.

In my current case I it does not matter if the services has crashed or it was explicitly stopped.

Best Answer

I think you are looking for this command :

systemctl list-units [-all] [--state=xxx]

I think this two commands show what you want to see :

systemctl list-units -all --state=inactive
systemctl list-units -all --state=failed

For more detailed explanations, you can refer to this answer :

https://superuser.com/questions/896812/all-systemd-states

Have a nice day.