chiark / gitweb /
systemctl: show cgroup tree if cgroup is empty but has non-empty children
authorLennart Poettering <lennart@poettering.net>
Thu, 11 Jul 2013 17:15:01 +0000 (19:15 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Jul 2013 17:15:01 +0000 (19:15 +0200)
This makes sure "systemctl status user.slice" shows a nice cgroup tree
of all logged in users.

src/systemctl/systemctl.c

index d25b7d6..2ea5a3b 100644 (file)
@@ -2788,7 +2788,7 @@ static void print_status_info(UnitStatusInfo *i) {
                 printf("   Status: \"%s\"\n", i->status_text);
 
         if (i->control_group &&
-            (i->main_pid > 0 || i->control_pid > 0 || cg_is_empty(SYSTEMD_CGROUP_CONTROLLER, i->control_group, false) == 0)) {
+            (i->main_pid > 0 || i->control_pid > 0 || cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, i->control_group, false) == 0)) {
                 unsigned c;
 
                 printf("   CGroup: %s\n", i->control_group);