all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 68258@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#68258] [PATCH 5/7] services: shepherd: Use the 0.10.x GOOPS-less interface.
Date: Fri,  5 Jan 2024 11:59:32 +0100	[thread overview]
Message-ID: <a932233a84600d1289ef6ca288a7a1218bb3f7d6.1704451578.git.ludo@gnu.org> (raw)
In-Reply-To: <cover.1704451578.git.ludo@gnu.org>

* gnu/services/shepherd.scm (%default-modules): Remove (oop goops).
(shepherd-service-file): Use (service …) instead of (make <service> …).
Use ‘actions’ instead of ‘make-actions’.
(scm->go): Remove use of (oop goops).
(shepherd-configuration-file): Pass ‘register-services’ a list.
Use ‘start-in-the-background’ unconditionally.

Change-Id: I0ad1ba32e339c56ee31e59f160b53d3581277d97
---
 gnu/services/shepherd.scm | 30 ++++++++++--------------------
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 8e122f1aab..5ebac129ce 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -183,7 +183,6 @@ (define %default-imported-modules
 (define %default-modules
   ;; Default set of modules visible in a service's file.
   `((shepherd service)
-    (oop goops)
     ((guix build utils) #:hide (delete))
     (guix build syscalls)))
 
@@ -300,10 +299,10 @@ (define (shepherd-service-file service)
                  #~(begin
                      (use-modules #$@(shepherd-service-modules service))
 
-                     (make <service>
-                       #:docstring '#$(shepherd-service-documentation service)
-                       #:provides '#$(shepherd-service-provision service)
-                       #:requires '#$(shepherd-service-requirement service)
+                     (service
+                      '#$(shepherd-service-provision service)
+                       #:documentation '#$(shepherd-service-documentation service)
+                       #:requirement '#$(shepherd-service-requirement service)
 
                        ;; The 'one-shot?' slot is new in Shepherd 0.6.0.
                        ;; Older versions ignore it.
@@ -313,7 +312,7 @@ (define (shepherd-service-file service)
                        #:start #$(shepherd-service-start service)
                        #:stop #$(shepherd-service-stop service)
                        #:actions
-                       (make-actions
+                       (actions
                         #$@(map (match-lambda
                                   (($ <shepherd-action> name proc doc)
                                    #~(#$name #$doc #$proc)))
@@ -338,7 +337,6 @@ (define (scm->go file shepherd)
 
                          ;; Do the same as the Shepherd's 'load-in-user-module'.
                          (let ((env (make-fresh-user-module)))
-                           (module-use! env (resolve-interface '(oop goops)))
                            (module-use! env (resolve-interface '(shepherd service)))
                            (with-target #$(or target #~%host-type)
                              (lambda _
@@ -401,25 +399,17 @@ (define (shepherd-configuration-file services shepherd)
           ;; than a kernel panic.
           (call-with-error-handling
             (lambda ()
-              (apply register-services
-                     (parameterize ((current-warning-port
-                                     (%make-void-port "w")))
-                       (map load-compiled '#$(map scm->go files))))))
+              (register-services
+               (parameterize ((current-warning-port
+                               (%make-void-port "w")))
+                 (map load-compiled '#$(map scm->go files))))))
 
           (format #t "starting services...~%")
           (let ((services-to-start
                  '#$(append-map shepherd-service-provision
                                 (filter shepherd-service-auto-start?
                                         services))))
-            (if (defined? 'start-in-the-background)
-                (start-in-the-background services-to-start)
-                (for-each (lambda (service)       ;pre-0.9.0 compatibility
-                            (guard (c ((service-error? c)
-                                       (format (current-error-port)
-                                               "failed to start service '~a'~%"
-                                               service)))
-                              (start service)))
-                          services-to-start))
+            (start-in-the-background services-to-start)
 
             ;; Hang up stdin.  At this point, we assume that 'start' methods
             ;; that required user interaction on the console (e.g.,
-- 
2.41.0





  parent reply	other threads:[~2024-01-05 11:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 10:59 [bug#68258] [PATCH 0/7] Upgrading Shepherd and moving the Hurd to 0.10.x Ludovic Courtès
2024-01-05 10:56 ` [bug#68258] [PATCH 1/7] services: openssh: Add dependency on ‘networking’ Ludovic Courtès
2024-01-05 18:00   ` Janneke Nieuwenhuizen
2024-01-05 10:59 ` [bug#68258] [PATCH 2/7] tests: childhurd: Increase SSH connection timeout Ludovic Courtès
2024-01-05 10:59 ` [bug#68258] [PATCH 3/7] DRAFT gnu: shepherd: Update to 0.10.3 Ludovic Courtès
2024-01-05 10:59 ` [bug#68258] [PATCH 4/7] system: hurd: Use the Shepherd 0.10.x Ludovic Courtès
2024-01-05 10:59 ` Ludovic Courtès [this message]
2024-01-05 10:59 ` [bug#68258] [PATCH 6/7] home: services: shepherd: Use the 0.10.x interface Ludovic Courtès
2024-01-05 10:59 ` [bug#68258] [PATCH 7/7] services: bitlbee: Use ‘make-inetd-constructor’ unconditionally Ludovic Courtès
2024-01-05 17:59 ` [bug#68258] [PATCH 0/7] Upgrading Shepherd and moving the Hurd to 0.10.x Janneke Nieuwenhuizen
2024-01-06 16:15   ` Janneke Nieuwenhuizen
2024-01-06 16:32     ` Janneke Nieuwenhuizen
2024-01-07 11:12     ` Ludovic Courtès
2024-01-07 14:54       ` Janneke Nieuwenhuizen
2024-01-08 23:54         ` bug#68258: " Ludovic Courtès
2024-01-07 11:14   ` [bug#68258] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a932233a84600d1289ef6ca288a7a1218bb3f7d6.1704451578.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=68258@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.