Hello,
Maxim Cournoyer <[email protected]> writes:
> Your analysis appears correct; the above 'make' runs with PID 3.
>
> --8<---------------cut here---------------start------------->8---
> maxim@terra ~/src/forgejo$ guix shell -CNF -m manifest.scm -- env GOPATH=/tmp
> TAGS="bindata timetzdata sqlite sqlite_unlock_notify" make build
> go: downloading go1.24.3 (linux/amd64)
> ^Cgo: downloading go1.24.3 (linux/amd64)
> ^Cgo: downloading go1.24.3 (linux/amd64)
> ^Cgo: downloading go1.24.3 (linux/amd64)
> ^Cgo: downloading go1.24.3 (linux/amd64)
> ^CForgejo requires Go 1.24 or greater to build. You can get it at
> https://go.dev/dl/
> make: *** [Makefile:297: go-check] Error 1
> ^C^C^C^C^C^C^C^C^C
> # doesn't abort, need kill -9 $pid
> --8<---------------cut here---------------end--------------->8---
>
> This doesn't handle signals as expected because it runs as PID 1. I
> agree this needs be documented or better, handled with --init ala
> docker.
I didn’t follow closely but how about this:
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 1c2d222c748..43cfffbd9cb 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -980,6 +980,11 @@ (define* (launch-environment/container #:key command bash user user-mappings
;; Call an additional setup procedure, if provided.
(when setup-hook
(setup-hook profile)))
+
+ ;; Do not run the shell as PID 1 since that prevents proper signal
+ ;; handling (?).
+ #:child-is-pid1? #f
+
#:guest-uid uid
#:guest-gid gid
#:writable-root? writable-root?
Thanks,
Ludo’.