From 2ca5575e9dbae6fe5dbbc370aef17492c6732454 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Wed, 22 Apr 2026 21:00:12 +0200 Subject: [PATCH] =?UTF-8?q?linux-container:=20Add=20#:child-is-pid1=3F=20t?= =?UTF-8?q?o=20=E2=80=98eval/container=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/system/linux-container.scm (eval/container): Add `#:child-is-pid1?`. Change-Id: I522783f22a38093d862f5cfad1c68baaacd4ecc5 Signed-off-by: Ludovic Courtès --- gnu/system/linux-container.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm index 1692ccea90d..1db25c170c8 100644 --- a/gnu/system/linux-container.scm +++ b/gnu/system/linux-container.scm @@ -356,13 +356,18 @@ Run the container with the given options.")) (mappings '()) (mounts '()) (namespaces %namespaces) - (guest-uid 0) (guest-gid 0)) + (guest-uid 0) (guest-gid 0) + (child-is-pid1? #t)) "Evaluate EXP, a gexp, in a new process executing in separate namespaces as listed in NAMESPACES. Add MOUNTS, a list of , and MAPPINGS, a list of , to the set of directories visible in the process's mount namespace. Inside the namespaces, run code as GUEST-UID and GUEST-GID. Return the process' exit status as a monadic value. +When CHILD-IS-PID1? is true, and if NAMESPACES contains 'pid', then the child +process runs directly as PID 1. See the documentation for +`(@@ (gnu build linux-container) call-with-container)` for further details. + This is useful to implement processes that, unlike derivations, are not entirely pure and need to access the outside world or to perform side effects." @@ -406,4 +411,5 @@ effects." #:populate-file-system populate-file-system #:namespaces namespaces #:guest-uid guest-uid - #:guest-gid guest-gid)))))) + #:guest-gid guest-gid + #:child-is-pid1? child-is-pid1?))))))