aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2025-03-22 17:47:26 +0100
committerLudovic Courtès <ludo@gnu.org>2025-04-06 11:24:06 +0200
commit96ae99c957d9723eda91c00f8ff5a2cae0489887 (patch)
tree02fc9c345cf07bd6766e2c70cd40da6d6605cb68
parentb16e3f451f0117450e71eb74871d8329f776a997 (diff)
downloadguix-96ae99c957d9723eda91c00f8ff5a2cae0489887.tar.gz
guix-96ae99c957d9723eda91c00f8ff5a2cae0489887.zip
services: guix: Streamline the default ‘start’ case.
* gnu/services/base.scm (guix-shepherd-service): In ‘start’ method, use ‘fork+exec-command’ in the default case. Change-Id: Id04d3d2651f89fbcdb2f17f027df91e132ff9ed1
-rw-r--r--gnu/services/base.scm31
1 files changed, 14 insertions, 17 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 6793822666..c7abc9b422 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2137,23 +2137,20 @@ proxy of 'guix-daemon'...~%")
(gid (if group (group:gid (getgrnam group)) -1)))
(chown "/var/guix/daemon-socket" uid gid))
- ;; Start the guix-daemon from a container, when supported,
- ;; to solve an installation issue. See the comment below for
- ;; more details.
- (fork+exec-command/container
- daemon-command
-
- ;; When running the installer, we need guix-daemon to
- ;; operate from within the same MNT namespace as the
- ;; installation container. In that case only, enter the
- ;; namespace of the process PID passed as start argument.
- ;; Otherwise, for symmetry purposes enter the caller
- ;; namespaces which is a no-op.
- #:pid (match args
- ((pid) (string->number pid))
- (else (getpid)))
- #:environment-variables environment-variables
- #:log-file #$log-file))))
+ (match args
+ (((= string->number (? integer? pid)))
+ ;; Start the guix-daemon in the same mnt namespace as
+ ;; PID. This is necessary when running the installer.
+ (fork+exec-command/container
+ daemon-command
+ #:pid pid
+ #:environment-variables environment-variables
+ #:log-file #$log-file))
+ (()
+ (fork+exec-command daemon-command
+ #:environment-variables
+ environment-variables
+ #:log-file #$log-file))))))
(stop #~(make-kill-destructor))))))
(define (guix-accounts config)