chiark / gitweb /
core,systemctl: add bus API to retrieve processes of a unit
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Apr 2016 13:28:28 +0000 (15:28 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:12:58 +0000 (10:12 +0200)
commit09afb73b0829acd3fd965eb55f85c5614b45b023
tree9b0a03209832f23c94a4d6cd0e43ae55b97c900c
parent35f78d53d1944f36139028820762ae8fa9884bdd
core,systemctl: add bus API to retrieve processes of a unit

This adds a new GetProcesses() bus call to the Unit object which returns an
array consisting of all PIDs, their process names, as well as their full cgroup
paths. This is then used by "systemctl status" to show the per-unit process
tree.

This has the benefit that the client-side no longer needs to access the
cgroupfs directly to show the process tree of a unit. Instead, it now uses this
new API, which means it also works if -H or -M are used correctly, as the
information from the specific host is used, and not the one from the local
system.

Fixes: #2945
src/basic/process-util.c
src/basic/process-util.h
src/shared/bus-unit-util.c [new file with mode: 0644]