GNU bug report logs - #30948
[PATCH core-updates] guix: Reap finished child processes in build containers.

Previous Next

Package: guix;

Reported by: Carlo Zancanaro <carlo <at> zancanaro.id.au>

Date: Mon, 26 Mar 2018 11:17:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #52 received at 30948 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 30948 <at> debbugs.gnu.org, Carlo Zancanaro <carlo <at> zancanaro.id.au>
Subject: Re: bug#30948: [PATCH core-updates] build-system/gnu: Turn PID 1
 into an “init”-style process by default.
Date: Sun, 17 Dec 2023 16:46:51 -0500
Hi Ludovic,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Fixes <https://issues.guix.gnu.org/30948>.
>
> * guix/build/gnu-build-system.scm (separate-from-pid1): New procedure.
> (%standard-phases): Add it.
> * guix/build-system/gnu.scm (gnu-build): Add #:separate-from-pid1? and
> honor it.
> (gnu-cross-build): Likewise.
>
> Reported-by: Carlo Zancanaro <carlo <at> zancanaro.id.au>
> Change-Id: I6f3bc8d8186d1a571f983a38d5e3fd178ffa2678
> ---
>  guix/build-system/gnu.scm       |  4 ++++
>  guix/build/gnu-build-system.scm | 39 ++++++++++++++++++++++++++++++++-
>  2 files changed, 42 insertions(+), 1 deletion(-)
>
> Hi!
>
> This is a second attempt I’m currently testing as part of an
> initially unrelated ‘core-updates’ series:
>
>   https://issues.guix.gnu.org/67824
>
> The principle is simple: if the build process runs as PID 1, fork
> so that PID 1 does nothing but call ‘waitpid’ in a loop while the
> actual build process runs as PID 2.
>
> This is simple and robust.  The code is written in a defensive way
> as an extra phase that can be disabled.
>
> Thoughts?

I haven't yet looked at the code, but looking at the bigger picture,
wouldn't it be a useful behavior to have for Guile itself?  Perhaps not,
as there already exists a Guile init manager (GNU Shepherd), but if it's
something relatively simple/compact to implement, perhaps it could find
its place in Guile itself, just like Bash implements correctly signal
handling when used as a PID 1 (if I'm not mistaken).

-- 
Thanks,
Maxim




This bug report was last modified 1 year and 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.