From b69d29ce049f12d463a589e18561dd10ee8c09f1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 16 Apr 2012 18:56:18 +0200 Subject: systemctl: show main and control PID explicitly in cgroup-show In some cases the main/control PID of a service can be outside of the services cgroups (for example, if logind readjusts the processes' cgroup). In order to clarify this for the user show the main/control PID in the cgroup tree nonetheless, but mark them specially. --- src/systemctl/systemctl.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/systemctl') diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index e8b8b51d76..d57e0931a5 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -2378,12 +2378,22 @@ static void print_status_info(UnitStatusInfo *i) { printf("\t CGroup: %s\n", i->default_control_group); if (arg_transport != TRANSPORT_SSH) { - if ((c = columns()) > 18) + unsigned k = 0; + pid_t extra[2]; + + c = columns(); + if (c > 18) c -= 18; else c = 0; - show_cgroup_by_path(i->default_control_group, "\t\t ", c, false, arg_all); + if (i->main_pid > 0) + extra[k++] = i->main_pid; + + if (i->control_pid > 0) + extra[k++] = i->control_pid; + + show_cgroup_and_extra_by_spec(i->default_control_group, "\t\t ", c, false, arg_all, extra, k); } } -- cgit v1.2.3-54-g00ecf