summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-12-23 11:56:13 +0100
committerLennart Poettering <lennart@poettering.net>2012-12-24 00:29:39 +0100
commitb08121d00467874ac9aa0dc6f59787877f1bb427 (patch)
tree02ec43591a75af54925396411ada914dabe01e22 /src/systemctl/systemctl.c
parent81dc4bde12acd0a59ad96a505dbb109a9e4f320e (diff)
systemctl: don't show cgroup field for a unit if cgroup is empty
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r--src/systemctl/systemctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 3abd7dc2e1..876e782e7d 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -2265,7 +2265,8 @@ static void print_status_info(UnitStatusInfo *i) {
if (i->status_text)
printf("\t Status: \"%s\"\n", i->status_text);
- if (i->default_control_group) {
+ if (i->default_control_group &&
+ (i->main_pid > 0 || i->control_pid > 0 || cg_is_empty_by_spec(i->default_control_group, false) == 0)) {
unsigned c;
printf("\t CGroup: %s\n", i->default_control_group);