diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-10-19 12:51:57 -0400 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-10-19 13:11:40 -0400 |
commit | 5e2140511c1ad9ccd731438b74d61b62111da1e6 (patch) | |
tree | a4ff748ad26e121b88469b5d921001ef1382be8f /gnu/build/shepherd.scm | |
parent | 9e3a5ee417ea7fe9721be8804ff047e80c4f22ed (diff) | |
parent | 353bdae32f72b720c7ddd706576ccc40e2b43f95 (diff) | |
download | guix-patches-5e2140511c1ad9ccd731438b74d61b62111da1e6.tar guix-patches-5e2140511c1ad9ccd731438b74d61b62111da1e6.tar.gz |
Merge branch 'staging'
Conflicts:
gnu/packages/admin.scm
gnu/packages/commencement.scm
gnu/packages/gdb.scm
gnu/packages/llvm.scm
gnu/packages/package-management.scm
gnu/packages/tls.scm
Diffstat (limited to 'gnu/build/shepherd.scm')
-rw-r--r-- | gnu/build/shepherd.scm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gnu/build/shepherd.scm b/gnu/build/shepherd.scm index 65141bd60f..91646288d5 100644 --- a/gnu/build/shepherd.scm +++ b/gnu/build/shepherd.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2020 Mathieu Othacehe <othacehe@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -196,11 +197,16 @@ namespace, in addition to essential bind-mounts such /proc." #:allow-other-keys #:rest args) "This is a variant of 'fork+exec-command' procedure, that joins the -namespaces of process PID beforehand." - (container-excursion* pid - (lambda () - (apply fork+exec-command command - (strip-keyword-arguments '(#:pid) args))))) +namespaces of process PID beforehand. If there is no support for containers, +on Hurd systems for instance, fallback to direct forking." + (let ((container-support? + (file-exists? "/proc/self/ns")) + (fork-proc (lambda () + (apply fork+exec-command command + (strip-keyword-arguments '(#:pid) args))))) + (if container-support? + (container-excursion* pid fork-proc) + (fork-proc)))) ;; Local Variables: ;; eval: (put 'container-excursion* 'scheme-indent-function 1) |