Bug 90606

Summary: RFE: systemctl has no way to see only the failing and inactive units
Product: systemd Reporter: Pacho Ramos <pachoramos1>
Component: generalAssignee: systemd-bugs
Status: RESOLVED WONTFIX QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Pacho Ramos 2015-05-23 18:44:55 UTC
I discovered that some units were not being started because I saw "no such file or directory" error in journalctl output. This showed me that maybe this kind of errors should be more visible, for example, while booting, in tty1.

But, apart of that, when I wanted to review for failed units I did:
# systemctl --failed
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

The no longer existing units are not considered as "failing" (even if they are failing to start and that is causing them to be "inactive" finally. But, even with that, I went with "systemctl --failed --all" that is not supported (I thought it would show me failing+inactive units) and, finally, I needed to run "systemctl --all" to see ALL units and look at the output for inactive ones. That is a bit overkill I think. Personally it should be easier to *only* list the failing+inactive units

Thanks a lot
Comment 1 Lennart Poettering 2015-05-26 14:00:18 UTC
Not sure I can parse this. 

Note that it's completely OK to have units listed in "systemctl list-units" that are missing. This is actually the most common case, since many services will carry After= or Before= dependencies on units that are not installed, simply because they want to define ordering in case they are installed on some systems, without unconditionally requiring them to be installed.

"systemctl list-units" shows all failed and all active units. It does not show any units that are referenced but could not be loaded because the unit files are missing.

Also, note that "--failed" is deprecated (and doesn't appear in the man page hence), use --state=failed instead.

Anyway, I really don't understand what you are trying tho point out though. Can you elaborate, please?
Comment 2 Pacho Ramos 2015-05-26 22:04:51 UTC
Sorry

In summary,

1. I install a package months ago and enable some of their unit files.
2. Long time after that, I uninstall it (or the package got the unit files dropped or renamed or...)
3. I don't notice the unit files that I enabled months ago are now really failing with a "no such file or directory" error until I see that errors when manually reviewing journalctl output :/

Then, I would like to have a way to notice that errors more easily as they are not really hidden
Comment 3 Zbigniew Jedrzejewski-Szmek 2018-03-09 08:00:44 UTC
Closing all stale bugs with NEEDINFO. Please open a new bug at https://github.com/systemd/issues if the problem still occurs.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.