summaryrefslogtreecommitdiff
path: root/src/systemctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemctl.c')
-rw-r--r--src/systemctl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 53b6b47b61..799f57d006 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -43,6 +43,7 @@
#include "strv.h"
#include "dbus-common.h"
#include "cgroup-show.h"
+#include "cgroup-util.h"
#include "list.h"
static const char *arg_type = NULL;
@@ -1053,6 +1054,7 @@ typedef struct UnitStatusInfo {
static void print_status_info(UnitStatusInfo *i) {
ExecStatusInfo *p;
+ int r;
assert(i);
@@ -1183,7 +1185,10 @@ static void print_status_info(UnitStatusInfo *i) {
else
c = 0;
- show_cgroup_recursive(i->default_control_group, "\t\t ", c);
+ if ((r = cg_init()) < 0)
+ log_error("Failed to initialize libcg: %s", strerror(-r));
+ else
+ show_cgroup_recursive(i->default_control_group, "\t\t ", c);
}
}