mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
environment: Properly handle SIGINT.
Switching to execlp means that the process spawned in a container is PID 1, which obsoleted one of the 'guix environment --container' tests because the init process can't be killed in the usual manner. * guix/scripts/environment.scm (launch-environment/fork): New procedure. (launch-environment): Switch from system* to execlp. Add handler for SIGINT. (guix-environment): Use launch-environment/fork. * tests/guix-environment-container.sh: Replace abnormal exit test with one that works now that the spawned process is PID 1.
This commit is contained in:
parent
c8786834ef
commit
13bc8d5e4f
2 changed files with 23 additions and 3 deletions
|
@ -82,8 +82,13 @@ grep -e "$NIX_STORE_DIR/.*-bash" $tmpdir/mounts # bootstrap bash
|
|||
|
||||
rm $tmpdir/mounts
|
||||
|
||||
abnormal_exit_code="
|
||||
(use-modules (system foreign))
|
||||
;; Purposely make Guile crash with a segfault. :)
|
||||
(pointer->string (make-pointer 123) 123)"
|
||||
|
||||
if guix environment --bootstrap --container \
|
||||
--ad-hoc bootstrap-binaries -- kill -SEGV 2
|
||||
--ad-hoc guile-bootstrap -- guile -c "$abnormal_exit_code"
|
||||
then false;
|
||||
else
|
||||
test $? -gt 127
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue