diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-04-16 18:56:18 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-04-16 18:59:40 +0200 |
commit | b69d29ce049f12d463a589e18561dd10ee8c09f1 (patch) | |
tree | 8990e2d696fd91de9886c0d60bc41ba98a299e2f /src/systemctl/systemctl.c | |
parent | 888c7102355af1450aa26253d60cc2cb46eeb71d (diff) |
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.
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r-- | src/systemctl/systemctl.c | 14 |
1 files changed, 12 insertions, 2 deletions
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); } } |