Bug 90601 - systemctl --user list-units includes system units
Summary: systemctl --user list-units includes system units
Status: RESOLVED NOTABUG
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-23 05:36 UTC by Tim Cuthbertson
Modified: 2015-05-24 15:06 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
unexpected user units (7.86 KB, text/plain)
2015-05-24 00:41 UTC, Tim Cuthbertson
Details

Description Tim Cuthbertson 2015-05-23 05:36:13 UTC
`systemctl --user list-units` includes user units, but also includes system units. This makes it difficult to see the status of user services, because they're mixed in with all the system services. It also makes it difficult for scripts to act on only user-level services.

`systemctl --user list-unit-files` seems to do the right thing - it displays only user unit files.

systemd version 216
Comment 1 Zbigniew Jedrzejewski-Szmek 2015-05-23 12:55:09 UTC
Can you be more specific: what unit do you say that are unexpected?
Comment 2 Tim Cuthbertson 2015-05-24 00:41:13 UTC
Created attachment 115998 [details]
unexpected user units

Sorry, I thought all system units were reported (and that it would be obvious). But on further inspection, it seems to be just .device, .mount and .swap system-level units which are reported.

Attached are the lines from my own user's `systemctl --user list-units` which I don't think should be present.
Comment 3 Zbigniew Jedrzejewski-Szmek 2015-05-24 01:44:39 UTC
Those are expected. In the user instance, device and mount and swap units are created to mirror current state of the system.
Comment 4 Tim Cuthbertson 2015-05-24 03:44:01 UTC
Thanks for the clarification. I've looked for documentation about this, but couldn't find any description of why this would be the case. I don't suppose you know where it's documented?
Comment 5 Zbigniew Jedrzejewski-Szmek 2015-05-24 15:06:56 UTC
I don't think it is or needs to be documented in any special way. Simply put, user services can depend on devices and other system-wide state the same as a system services.


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.