;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2020 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu build shepherd) #:use-module (gnu system file-systems) #:use-module (gnu build linux-container) #:use-module (guix build utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-06-18 23:25:53 +0200
committerLudovic Courtès <ludo@gnu.org>2018-06-18 23:25:53 +0200
commitd6b5aa0b031f0e7091f7424ac616d1c4d10fed5b (patch)
treecdc198dca5fb504210de0d857901f21794468141 /gnu/system/mapped-devices.scm
parent92d581a0fd9118d8586aff2746339007f67da232 (diff)
downloadguix-d6b5aa0b031f0e7091f7424ac616d1c4d10fed5b.tar.gz
guix-d6b5aa0b031f0e7091f7424ac616d1c4d10fed5b.zip
build-self: Do not rely on '%store-database-directory'.
Guix'es older than one week don't have this variable so requiring it would break things for them. * build-aux/build-self.scm (%config-variables): Remove '%store-database-directory'.
Diffstat (limited to 'gnu/system/mapped-devices.scm')
0 files changed, 0 insertions, 0 deletions
n-container container-directory mounts namespaces 1 (lambda () ;; First restore the default handlers. (for-each (cut sigaction <> SIG_DFL) %precious-signals) ;; Unblock any signals that have been blocked ;; by the parent process. (unblock-signals %precious-signals) (mkdir-p "/var/run") (clean-up pid-file) (exec-command command #:user user #:group group #:log-file log-file #:directory directory #:environment-variables environment-variables))))) (if pid-file (if (or (memq 'mnt namespaces) (memq 'pid namespaces)) (read-pid-file/container pid pid-file #:max-delay pid-file-timeout) (read-pid-file pid-file #:max-delay pid-file-timeout)) pid)))) (define* (fork+exec-command/container command #:key pid #:allow-other-keys #:rest args) "This is a variant of 'fork+exec-command' procedure, that joins the namespaces of process PID beforehand. If there is no support for containers, on Hurd systems for instance, fallback to direct forking." (define (strip-pid args) ;; TODO: Replace with 'strip-keyword-arguments' when that no longer pulls ;; in (guix config). (let loop ((args args) (result '())) (match args (() (reverse result)) ((#:pid _ . rest) (loop rest result)) ((head . rest) (loop rest (cons head result)))))) (let ((container-support? (file-exists? "/proc/self/ns")) (fork-proc (lambda () (apply fork+exec-command command (strip-pid args))))) (if container-support? (container-excursion* pid fork-proc) (fork-proc)))) ;; Local Variables: ;; eval: (put 'container-excursion* 'scheme-indent-function 1) ;; End: ;;; shepherd.scm ends here