On Mi, 29.03.23 09:19, Stephan Bergmann (sbergman@xxxxxxxxxx) wrote: > On 28/03/2023 22:58, Lennart Poettering wrote: > > On Di, 28.03.23 08:13, Stephan Bergmann (sbergman@xxxxxxxxxx) 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.) It does not. Lennart -- Lennart Poettering, Berlin