<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 28, 2023 at 9:13 AM Stephan Bergmann <<a href="mailto:sbergman@redhat.com">sbergman@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 27/03/2023 13:38, Lennart Poettering wrote:<br>
> another idea: can't you just wrap your tests in "systemd-run --scope<br>
> --user --name=somtestid47110815.scope" or so? we pick up unit<br>
> names in coredump handling. With that you'd run yur tests inside a<br>
> scope unit, and can then use that as key in logs+coredump.<br>
<br>
Thanks, that looks useful, `systemd-run --scope --user --unit=... ...` <br>
and `coredumpctl debug COREDUMP_USER_UNIT=....scope ...`.<br>
<br>
* Is it guaranteed for system-run --scope that the wrapped command will <br>
run in the surrounding process group? (Because LibreOffice' Jenkins <br>
relies on a single process group for a whole `make check` to reliably <br>
kill stuck builds. And it looks like systemd-run --scope is just a <br>
lightweight wrapper that then exec's the command in the same process, <br>
which looks promising.)<br></blockquote><div><br></div><div>While I'm not sure about whether the same pgroup is guaranteed, once you've started using scopes it might be more reliable to *systemctl stop the scope* in order to kill a stuck build, without relying on process groups anymore.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
* Is there a grammar for those --unit=X resp. <br>
COREDUMP_USER_UNIT=X'.scope values? I noticed that at least "/" in X <br>
gets replaced with "-" in X'. Is there a length limit?<br></blockquote><div><br></div><div>Slashes are not supported in unit names (translated to a dash as part of the escaping), as a unit name has to be a valid filename. The "@" has special meaning (indicates instance name for .service units; I don't think that's supported for .scope units though). Usually "foo-bar-baz-12345.scope" is the typical format.<br></div></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>