home: Run child as pid 2.

To test, use a sample home configuration and a command such as:

    guix home container home.scm -- sleep 10

Before this commit, hitting `^C` would not have any effect, as `sleep`
does not explicitly register a signal handler for `SIGINT`. With this
commit, `guix home container` forwards the signal to `sleep`, which
then exits.

* guix/scripts/home.scm (spawn-home-container): Instruct
  `eval/container` to not run our child directly as pid 1 in the spawned
  container, as it may not expect to run as an init process.

Change-Id: Ib997a0386d0851978d197fbd2dfb139141d13065
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #8051
This commit is contained in:
Johannes Christ
2026-04-22 21:02:10 +02:00
committed by Ludovic Courtès
parent 2ca5575e9d
commit 78053b9004

View File

@@ -372,7 +372,8 @@ immediately. Return the exit status of the process in the container."
(check? #f))) (check? #f)))
#:mappings (append network-mappings mappings) #:mappings (append network-mappings mappings)
#:guest-uid uid #:guest-uid uid
#:guest-gid gid)) #:guest-gid gid
#:child-is-pid1? #f))
;;; ;;;