[systemd-devel] coredumpctl: matching by e.g. env var?

Stephan Bergmann sbergman at redhat.com
Wed Mar 29 07:19:41 UTC 2023


On 28/03/2023 22:58, Lennart Poettering wrote:
> On Di, 28.03.23 08:13, Stephan Bergmann (sbergman at redhat.com) wrote:
>> * Is it guaranteed for system-run --scope that the wrapped command will run
>> in the surrounding process group?  (Because LibreOffice' Jenkins relies on a
>> single process group for a whole `make check` to reliably kill stuck builds.
>> And it looks like systemd-run --scope is just a lightweight wrapper that
>> then exec's the command in the same process, which looks promising.)
> 
> Yes. Process groups and control groups are orthogonal. Moving a
> process into a cgroup via systemd's "scope" concept won't affect
> process group membership.
> 
> In fact, Linux doesn't have any API to change process group membership
> from the "outside" anyway. Processes can only do this from "inside"
> the process. Hence even if we wanted, we couln't affect that.

(My concern was that the implementation of `systemd-run --scope` might 
call something like `setpgid(getpid(), getpid())` to establish a new 
process group, which would then be inherited by the fork'ed or exec'ed 
command.)



More information about the systemd-devel mailing list