summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven Allen <steven@stebalien.com>2015-07-20 11:57:45 -0400
committerSteven Allen <steven@stebalien.com>2015-07-22 17:53:14 -0400
commit065d6296116be348bf59b7017b4bf22f76815e0c (patch)
treea393022ff86bc7b0637cfe7b7d2d8005b836abbf /src
parent6913b32249eeaabf00184872de189e1a8889ab74 (diff)
cgls: machines can also be services
This makes `systemd-cgls -M <machine name>` work with nspawn containers in systemd 222.
Diffstat (limited to 'src')
-rw-r--r--src/cgls/cgls.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c
index 46a444340a..b8d1d2ccaf 100644
--- a/src/cgls/cgls.c
+++ b/src/cgls/cgls.c
@@ -197,19 +197,19 @@ int main(int argc, char *argv[]) {
if (arg_machine) {
char *m;
const char *cgroup;
- _cleanup_free_ char *scope = NULL;
+ _cleanup_free_ char *unit = NULL;
_cleanup_free_ char *path = NULL;
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
m = strjoina("/run/systemd/machines/", arg_machine);
- r = parse_env_file(m, NEWLINE, "SCOPE", &scope, NULL);
+ r = parse_env_file(m, NEWLINE, "SCOPE", &unit, NULL);
if (r < 0) {
log_error_errno(r, "Failed to get machine path: %m");
goto finish;
}
- path = unit_dbus_path_from_name(scope);
+ path = unit_dbus_path_from_name(unit);
if (!path) {
log_oom();
goto finish;
@@ -219,7 +219,7 @@ int main(int argc, char *argv[]) {
bus,
"org.freedesktop.systemd1",
path,
- "org.freedesktop.systemd1.Scope",
+ endswith(unit, ".scope") ? "org.freedesktop.systemd1.Scope" : "org.freedesktop.systemd1.Service",
"ControlGroup",
&error,
&reply,