Commit 1f16b4a6 authored by Lennart Poettering's avatar Lennart Poettering
Browse files

cgls: by default start with group of PID 1

parent 1f73f0f1
......@@ -106,8 +106,18 @@ int main(int argc, char *argv[]) {
if (path_startswith(p, "/sys/fs/cgroup")) {
printf("Working Directory %s:\n", p);
r = show_cgroup_by_path(p, NULL, 0);
} else
r = show_cgroup(SYSTEMD_CGROUP_CONTROLLER, "/", NULL, 0);
} else {
char *root = NULL;
const char *t = NULL;
if ((r = cg_get_by_pid(SYSTEMD_CGROUP_CONTROLLER, 1, &root)) < 0)
t = "/";
else
t = root;
r = show_cgroup(SYSTEMD_CGROUP_CONTROLLER, t, NULL, 0);
free(root);
}
free(p);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment