Subject: The Shepherd on GNU/Hurd

From: Ludovic Courtès <[email-masked]>
Date: Wed, 07 Jun 2023 11:40:04 +0200

Ludovic Courtès <[email-masked]> skribis:

> To me it’s important so we can upgrade the Shepherd in use on GNU/Hurd
> (it’s still stuck at 0.8 because so far Fibers lacked support for
> non-Linux systems), which in turn means we can use the newer Shepherd
> APIs in its config file.  Unfortunately, while shepherd cross-builds
> and runs on GNU/Hurd, I’m not confident it “works”.  I’ll write more
> in a separate message.

The patch I ended up not including in this series is use of current
Shepherd on GNU/Hurd (attached).

Problems that I see are:

  • ‘networking’ gets stuck in ‘starting’ state.  My guess is that it
    uses ‘system*’ (the replacement provided by shepherd) and that one
    does not return because we never get SIGCHLD.

  • (@ (ice-9 threads) all-threads) says there are two threads.  That
    was already the case with 0.8, but it’s no good.

Also, I haven’t tried to run the Shepherd’s test suite natively on
GNU/Hurd; I’m sure it’d uncover problems.

Overall, I’m pessimistic about signal handling without ‘signalfd’.  We
could try to get shepherd to kinda work without ‘signalfd’ (we could
even test that code path on GNU/Linux), but that’s going to be brittle
as we can already see.

What d’ya think, comrades?

Ludo’.

diff --git a/gnu/system.scm b/gnu/system.scm
index 354f58f55b..5c4c045e28 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -804,9 +804,7 @@ (define (hurd-default-essential-services os)
           %boot-service
           %hurd-startup-service
           %activation-service
-          (service shepherd-root-service-type
-                   (shepherd-configuration
-                    (shepherd shepherd-0.8)))     ;no Fibers
+          (service shepherd-root-service-type)
 
           (service user-processes-service-type)
           (account-service (append (operating-system-accounts os)
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 558d1ee9e3..0aa473fd42 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2020-2022 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2020-2023 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -68,7 +68,7 @@ (define %base-packages/hurd
   ;; Note: the Shepherd comes before the Hurd, not just because its duty is to
   ;; shepherd the herd, but also because we want its 'halt' and 'reboot'
   ;; commands to take precedence.
-  (list shepherd-0.8 hurd bash coreutils file findutils grep sed
+  (list shepherd-0.10 hurd bash coreutils file findutils grep sed
         diffutils patch gawk tar gzip bzip2 xz lzip
         guile-3.0-latest guile-colorized guile-readline
         net-base inetutils less shadow sudo which