guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] 09/09: service: Use 'service' procedure to replace (make <ser


From: Ludovic Courtès
Subject: [shepherd] 09/09: service: Use 'service' procedure to replace (make <service> ...).
Date: Thu, 6 Apr 2023 17:03:15 -0400 (EDT)

civodul pushed a commit to branch wip-goopsless
in repository shepherd.

commit c6cb3eee783c43ef61c58331a3d707f113593f22
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Apr 5 23:31:26 2023 +0200

    service: Use 'service' procedure to replace (make <service> ...).
    
    * doc/shepherd.texi, modules/shepherd/service/monitoring.scm,
    modules/shepherd/service/repl.scm,
    modules/shepherd/support.scm: Replace (make <service> ...) with the
    new (service ...) form.
    * tests/basic.sh, tests/close-on-exec.sh,
    tests/eval-load.sh, tests/file-creation-mask.sh,
    tests/forking-service.sh, tests/inetd.sh, tests/logging.sh,
    tests/one-shot.sh, tests/pid-file.sh, tests/replacement.sh,
    tests/respawn-throttling.sh, tests/respawn.sh, tests/restart.sh,
    tests/signals.sh, tests/starting-status.sh,
    tests/status-sexp.sh, tests/stopping-status.sh,
    tests/system-star.sh, tests/systemd.sh, tests/transient.sh: Likewise.
---
 doc/shepherd.texi                       | 16 ++++++-------
 modules/shepherd/service/monitoring.scm |  8 +++----
 modules/shepherd/service/repl.scm       | 40 ++++++++++++++++-----------------
 modules/shepherd/support.scm            |  4 ++--
 tests/basic.sh                          | 24 ++++++++++----------
 tests/close-on-exec.sh                  | 16 ++++++-------
 tests/eval-load.sh                      |  8 +++----
 tests/file-creation-mask.sh             |  4 ++--
 tests/forking-service.sh                | 18 +++++++--------
 tests/inetd.sh                          | 16 ++++++-------
 tests/logging.sh                        |  8 +++----
 tests/one-shot.sh                       | 36 ++++++++++++++---------------
 tests/pid-file.sh                       | 12 +++++-----
 tests/replacement.sh                    |  8 +++----
 tests/respawn-throttling.sh             |  4 ++--
 tests/respawn.sh                        |  8 +++----
 tests/restart.sh                        | 16 ++++++-------
 tests/signals.sh                        |  4 ++--
 tests/starting-status.sh                |  4 ++--
 tests/status-sexp.sh                    | 14 ++++++------
 tests/stopping-status.sh                |  4 ++--
 tests/system-star.sh                    | 12 +++++-----
 tests/systemd.sh                        |  8 +++----
 tests/transient.sh                      |  8 +++----
 24 files changed, 150 insertions(+), 150 deletions(-)

diff --git a/doc/shepherd.texi b/doc/shepherd.texi
index 154199c..56200d6 100644
--- a/doc/shepherd.texi
+++ b/doc/shepherd.texi
@@ -1183,8 +1183,8 @@ for this one service:
 
 @lisp
 (define mcron
-  (make <service>
-    #:provides '(mcron)
+  (service
+    '(mcron)
     ;; Run /usr/bin/mcron without any command-line arguments.
     #:start (make-forkexec-constructor '("/usr/bin/mcron"))
     #:stop (make-kill-destructor)
@@ -1221,8 +1221,8 @@ has started and is ready to accept connections:
 
 @lisp
 (define sshd
-  (make <service>
-    #:provides '(sshd ssh-daemon)  ;for convenience, give it two names
+  (service
+    '(sshd ssh-daemon)  ;for convenience, give it two names
     #:start (make-forkexec-constructor
              '("/usr/sbin/sshd" "-D")
              #:pid-file "/etc/ssh/sshd.pid")
@@ -1241,8 +1241,8 @@ enabled by passing the @option{-i} command-line option:
 
 @lisp
 (define sshd
-  (make <service>
-    #:provides '(sshd ssh-daemon)
+  (service
+    '(sshd ssh-daemon)
     #:start (make-inetd-constructor
              '("/usr/sbin/sshd" "-D" "-i")
              (list (endpoint
@@ -1334,8 +1334,8 @@ Then, individual user services can be put in
 (use-modules (shepherd support))
 
 (define ssh-agent
-  (make <service>
-    #:provides '(ssh-agent)
+  (service
+    '(ssh-agent)
     #:docstring "Run `ssh-agent'"
     #:start (lambda ()
               (let ((socket-dir (string-append %user-runtime-dir 
"/ssh-agent")))
diff --git a/modules/shepherd/service/monitoring.scm 
b/modules/shepherd/service/monitoring.scm
index 9763841..853eb58 100644
--- a/modules/shepherd/service/monitoring.scm
+++ b/modules/shepherd/service/monitoring.scm
@@ -71,10 +71,10 @@
                              (period (default-monitoring-period)))
   "Return a service that will monitor shepherd resource usage by printing it
 every @var{period} seconds."
-  (make <service>
-    #:docstring "Periodically log shepherd resource usage information."
-    #:provides '(monitoring)
-    #:requires '()
+  (service
+    '(monitoring)
+    #:documentation "Periodically log shepherd resource usage information."
+    #:requirement '()
     #:start (lambda args
               (spawn-monitoring-service #:period period))
     #:stop (lambda (channel)
diff --git a/modules/shepherd/service/repl.scm 
b/modules/shepherd/service/repl.scm
index 8e0ae13..a5f9785 100644
--- a/modules/shepherd/service/repl.scm
+++ b/modules/shepherd/service/repl.scm
@@ -32,22 +32,22 @@
 (define (spawn-child-service client id)
   "Register and start a new service that runs a REPL on @var{client}, a
 socket.  Use @var{id} to create the service name."
-  (letrec* ((name    (string->symbol
-                      (string-append "repl-client-"
-                                     (number->string id))))
-            (service (make <service>
-                       #:provides (list name)
-                       #:transient? #t
-                       #:start (lambda ()
-                                 (spawn-fiber
-                                  (lambda ()
-                                    (run-client-repl service client)))
-                                 client)
-                       #:stop (lambda (client)
-                                (close-port client)
-                                #f))))
-    (register-services service)
-    (start service)))
+  (letrec* ((name  (string->symbol
+                    (string-append "repl-client-"
+                                   (number->string id))))
+            (child (service
+                     (list name)
+                     #:transient? #t
+                     #:start (lambda ()
+                               (spawn-fiber
+                                (lambda ()
+                                  (run-client-repl child client)))
+                               client)
+                     #:stop (lambda (client)
+                              (close-port client)
+                              #f))))
+    (register-services child)
+    (start child)))
 
 (define* (run-repl-service socket)
   (let loop ((client-id 1))
@@ -98,10 +98,10 @@ crashes, stop @var{service}."
 (define* (repl-service #:optional
                        (socket-file (default-repl-socket-file)))
   "Return a REPL service that listens to @var{socket-file}."
-  (make <service>
-    #:docstring (l10n "Run a read-eval-print loop (REPL).")
-    #:provides '(repl)
-    #:requires '()
+  (service
+    '(repl)
+    #:documentation (l10n "Run a read-eval-print loop (REPL).")
+    #:requirement '()
     #:start (lambda args
               (catch-system-error (delete-file socket-file))
               (let ((socket (open-server-socket socket-file)))
diff --git a/modules/shepherd/support.scm b/modules/shepherd/support.scm
index 16ef9ee..445ccbe 100644
--- a/modules/shepherd/support.scm
+++ b/modules/shepherd/support.scm
@@ -330,7 +330,7 @@ TARGET should be a string representing a filepath + name."
         "\n"
         (l10n "\
 ;; Services known to shepherd:
-;; Add new services (defined using 'make <service>') to shepherd here by
+;; Add new services (defined using 'service') to shepherd here by
 ;; providing them as arguments to 'register-services'.\n")
         "(register-services)\n\n"
         (l10n "\
@@ -387,7 +387,7 @@ create a template configuration file if non exists."
   "Return a new module, for use when evaluating the user's configuration,
 which has essential bindings pulled in."
   (let ((m (make-fresh-user-module)))
-    ;; The typical configuration file wants to do '(make <service> ...)', and
+    ;; The typical configuration file wants to do '(service ...)', and
     ;; '(register-services ...)', so provide the relevant bindings by default.
     (module-use! m (resolve-interface '(oop goops)))
     (module-use! m (resolve-interface '(shepherd service)))
diff --git a/tests/basic.sh b/tests/basic.sh
index 0ad2a07..181c81b 100644
--- a/tests/basic.sh
+++ b/tests/basic.sh
@@ -37,8 +37,8 @@ trap "cat $log || true; rm -f $socket $conf $stamp $log;
 cat > "$conf"<<EOF
 (use-modules (srfi srfi-26))
 (register-services
- (make <service>
-   #:provides '(test)
+ (service
+   '(test)
    #:start (lambda _
              (call-with-output-file "$stamp"
                (cut display "foo" <>))
@@ -46,9 +46,9 @@ cat > "$conf"<<EOF
    #:stop  (lambda _
              (delete-file "$stamp"))
    #:respawn? #f)
- (make <service>
-   #:provides '(test-2)
-   #:requires '(test)
+ (service
+   '(test-2)
+   #:requirement '(test)
    #:start (lambda _
              (call-with-output-file "$stamp-2"
                (cut display "bar" <>))
@@ -61,13 +61,13 @@ cat > "$conf"<<EOF
                                  #t))
                           (fail "Fail." (const #f)))
    #:respawn? #f)
- (make <service>
-   #:provides '(spawn-with-system)
+ (service
+   '(spawn-with-system)
    #:start (make-system-constructor "echo starting from $PWD")
    #:stop (make-system-destructor "echo stopping from $PWD"))
- (make <service>
-   #:provides '(broken)
-   #:requires '()
+ (service
+   '(broken)
+   #:requirement '()
    #:start (lambda _
              (mkdir "/this/throws/a/system/error"))
    #:stop  (const #f)
@@ -185,7 +185,7 @@ test "`$herd status`" == "$pristine_status"
 mkdir -p "$confdir"
 cat > "$confdir/some-conf.scm" <<EOF
 (register-services
- (make <service>
+ (make <service>                ;deprecated
    #:provides '(test-loaded)
    #:start (const 'abc)
    #:stop (const #f)))
@@ -210,7 +210,7 @@ $herd unload root test-loaded
 # make sure that the running value is clamped before being sent over the wire.
 cat > "$confdir/some-conf.scm" <<EOF
 (register-services
- (make <service>
+ (make <service>               ;deprecated
    #:provides '(test-loaded)
    #:start (const (if #f #f))  ;#<undefined>
    #:stop (const #f)))
diff --git a/tests/close-on-exec.sh b/tests/close-on-exec.sh
index d3fe8ee..62e82fa 100644
--- a/tests/close-on-exec.sh
+++ b/tests/close-on-exec.sh
@@ -82,17 +82,17 @@ EOF
 
 cat > "$conf" <<EOF
 (register-services
- (make <service>
-   #:provides '(system-ctor)
+ (service
+   '(system-ctor)
    #:start (make-system-constructor "$exe")
    #:stop  (const #f)
    #:one-shot? #t)
- (make <service>
-   #:provides '(forkexec-ctor)
+ (service
+   '(forkexec-ctor)
    #:start (make-forkexec-constructor '("$(type -P sleep)" "100"))
    #:stop (make-kill-destructor))
- (make <service>
-   #:provides '(inetd-ctor)
+ (service
+   '(inetd-ctor)
    #:start (make-inetd-constructor '("$exe")
                                    (list
                                     (endpoint (make-socket-address
@@ -100,8 +100,8 @@ cat > "$conf" <<EOF
                                                INADDR_LOOPBACK
                                                5555))))
    #:stop  (make-inetd-destructor))
- (make <service>
-   #:provides '(systemd-ctor)
+ (service
+   '(systemd-ctor)
    #:start (make-systemd-constructor '("$exe")
                                     (list
                                      (endpoint (make-socket-address
diff --git a/tests/eval-load.sh b/tests/eval-load.sh
index c273797..5f019a0 100755
--- a/tests/eval-load.sh
+++ b/tests/eval-load.sh
@@ -31,12 +31,12 @@ trap "rm -f $socket $conf $log;
 
 cat > "$conf" <<EOF
 (register-services
- (make <service>
-   #:provides '(a)
+ (service
+   '(a)
    #:start (const #t)
    #:respawn? #f)
- (make <service>
-   #:provides '(b)
+ (service
+   '(b)
    #:start (const #t)
    #:respawn? #f))
 EOF
diff --git a/tests/file-creation-mask.sh b/tests/file-creation-mask.sh
index 9f5f10a..372e9fc 100644
--- a/tests/file-creation-mask.sh
+++ b/tests/file-creation-mask.sh
@@ -48,8 +48,8 @@ cat > "$conf"<<EOF
   '("$SHELL" "-c" "touch $PWD/$service_new_file; echo foo"))
 
 (register-services
- (make <service>
-   #:provides '(test)
+ (service
+   '(test)
    #:start (make-forkexec-constructor %command
                                       #:log-file "$PWD/$service_log"
                                       ;; Set the umask such that file
diff --git a/tests/forking-service.sh b/tests/forking-service.sh
index ddf9f3e..46f7b01 100644
--- a/tests/forking-service.sh
+++ b/tests/forking-service.sh
@@ -53,9 +53,9 @@ cat > "$conf"<<EOF
   '("$SHELL" "-c" "ulimit -n >$PWD/$service_nofiles; sleep 600 & echo \$! > 
$PWD/$service_pid"))
 
 (register-services
- (make <service>
+ (service
    ;; A service that forks into a different process.
-   #:provides '(test)
+   '(test)
    #:start (make-forkexec-constructor %command
                                       #:pid-file "$PWD/$service_pid"
                                       #:resource-limits '((nofile 1567 1567)))
@@ -66,9 +66,9 @@ cat > "$conf"<<EOF
   '("$SHELL" "-c" "echo started >> $PWD/$service2_started; sleep 600 & echo 
\$! > $PWD/$service2_pid"))
 
 (register-services
- (make <service>
+ (service
    ;; A service that forks into a different process.
-   #:provides '(test2)
+   '(test2)
    #:start (make-forkexec-constructor %command2
                                       #:pid-file "$PWD/$service2_pid")
    #:stop  (make-kill-destructor)
@@ -78,9 +78,9 @@ cat > "$conf"<<EOF
   '("$SHELL" "-c" "sleep 600"))
 
 (register-services
- (make <service>
+ (service
    ;; A service that forks into a different process.
-   #:provides '(test3)
+   '(test3)
    #:start (make-forkexec-constructor %command3)
    #:stop  (make-kill-destructor)
    #:respawn? #t))
@@ -89,10 +89,10 @@ cat > "$conf"<<EOF
   '("$SHELL" "-c" "trap 'echo ignoring SIGTERM' SIGTERM; while true ; do : ; 
done"))
 
 (register-services
- (make <service>
+ (service
    ;; A service that ignores SIGTERM.
-   #:provides '(test4)
-   #:requires '(test3)
+   '(test4)
+   #:requirement '(test3)
    #:start (make-forkexec-constructor %command4)
    #:stop  (make-kill-destructor SIGTERM #:grace-period 3)))
 EOF
diff --git a/tests/inetd.sh b/tests/inetd.sh
index 5d1c6d1..c0bc53b 100644
--- a/tests/inetd.sh
+++ b/tests/inetd.sh
@@ -39,8 +39,8 @@ cat > "$conf" <<EOF
   '("$SHELL" "-c" "echo hello; read line; echo \$line; echo done"))
 
 (register-services
- (make <service>
-   #:provides '(test-inetd)
+ (service
+   '(test-inetd)
    #:start (make-inetd-constructor %command
                                    (list
                                     (endpoint (make-socket-address
@@ -48,8 +48,8 @@ cat > "$conf" <<EOF
                                                INADDR_LOOPBACK
                                                $PORT))))
    #:stop  (make-inetd-destructor))
- (make <service>
-   #:provides '(test-inetd6)
+ (service
+   '(test-inetd6)
    #:start (make-inetd-constructor %command
                                    (list
                                     (endpoint (make-socket-address
@@ -61,8 +61,8 @@ cat > "$conf" <<EOF
                                                IN6ADDR_LOOPBACK
                                                $PORT))))
    #:stop  (make-inetd-destructor))
- (make <service>
-   #:provides '(test-inetd-v6-only)
+ (service
+   '(test-inetd-v6-only)
    #:start (make-inetd-constructor %command
                                    (list
                                     (endpoint (make-socket-address
@@ -70,8 +70,8 @@ cat > "$conf" <<EOF
                                                IN6ADDR_LOOPBACK
                                                $PORT))))
    #:stop  (make-inetd-destructor))
- (make <service>
-   #:provides '(test-inetd-unix)
+ (service
+   '(test-inetd-unix)
    #:start (make-inetd-constructor %command
                                    (list
                                     (endpoint (make-socket-address
diff --git a/tests/logging.sh b/tests/logging.sh
index 4d7a652..d0c0ca6 100644
--- a/tests/logging.sh
+++ b/tests/logging.sh
@@ -48,17 +48,17 @@ cat > "$conf"<<EOF
   '("$SHELL" "$service_script"))
 
 (register-services
- (make <service>
+ (service
    ;; Service with built-in logging.
-   #:provides '(test-builtin-logging)
+   '(test-builtin-logging)
    #:start (make-forkexec-constructor %command
                                       #:pid-file "$PWD/$service_pid")
    #:stop  (make-kill-destructor)
    #:respawn? #f)
 
- (make <service>
+ (service
    ;; Service with built-in logging.
-   #:provides '(test-file-logging)
+   '(test-file-logging)
    #:start (make-forkexec-constructor %command
                                       #:log-file "$PWD/$service_log"
                                       #:pid-file "$PWD/$service_pid")
diff --git a/tests/one-shot.sh b/tests/one-shot.sh
index 5e9bc9b..22e29fe 100644
--- a/tests/one-shot.sh
+++ b/tests/one-shot.sh
@@ -34,20 +34,20 @@ trap "cat $log || true; rm -f $socket $conf $stamp $log;
 cat > "$conf"<<EOF
 (use-modules (srfi srfi-26))
 (register-services
- (make <service>
-   #:provides '(always-fail)
+ (service
+   '(always-fail)
    #:start (const #f)
    #:one-shot? #t)
- (make <service>
-   #:provides '(test)
+ (service
+   '(test)
    #:start (lambda _
              (call-with-output-file "$stamp"
                (cut display "foo" <>))
              #t)
    #:one-shot? #t)
- (make <service>
-   #:provides '(test-2)
-   #:requires '(test)
+ (service
+   '(test-2)
+   #:requirement '(test)
    #:start (lambda _
              (call-with-output-file "$stamp-2"
                (cut display "bar" <>))
@@ -57,21 +57,21 @@ cat > "$conf"<<EOF
              #f))
 
  ;; Several services depending on the same one-shot service.
- (make <service>
-   #:provides '(one-shotty)
+ (service
+   '(one-shotty)
    #:start (const #t)
    #:one-shot? #t)
- (make <service>
-   #:provides '(a)
-   #:requires '(one-shotty)
+ (service
+   '(a)
+   #:requirement '(one-shotty)
    #:start (const #t))
- (make <service>
-   #:provides '(b)
-   #:requires '(a one-shotty)
+ (service
+   '(b)
+   #:requirement '(a one-shotty)
    #:start (const #t))
- (make <service>
-   #:provides '(c)
-   #:requires '(a b one-shotty)
+ (service
+   '(c)
+   #:requirement '(a b one-shotty)
    #:start (const #t)))
 
 (start-in-the-background '(a b c))
diff --git a/tests/pid-file.sh b/tests/pid-file.sh
index 5fb0f2b..d5fb90a 100644
--- a/tests/pid-file.sh
+++ b/tests/pid-file.sh
@@ -59,10 +59,10 @@ cat > "$conf"<<EOF
                         (sleep 100))))))
 
 (register-services
- (make <service>
+ (service
    ;; A service that never produces its PID file, yet leaves a process
    ;; behind it.
-   #:provides '(test)
+   '(test)
    #:start (make-forkexec-constructor %command
                                       #:pid-file "/does-not-exist"
 
@@ -74,19 +74,19 @@ cat > "$conf"<<EOF
    #:stop  (make-kill-destructor)
    #:respawn? #f)
 
- (make <service>
+ (service
    ;; Same one, but actually produces the PID file.
-   #:provides '(test-works)
+   '(test-works)
    #:start (make-forkexec-constructor %daemon-command-successful
                                       #:pid-file "$PWD/$service_pid"
                                       #:pid-file-timeout 6)
    #:stop  (make-kill-destructor)
    #:respawn? #f)
 
- (make <service>
+ (service
    ;; This one "daemonizes", fails to create a PID file, but leaves
    ;; a child process behind it.
-   #:provides '(test-daemonizes)
+   '(test-daemonizes)
    #:start (make-forkexec-constructor %daemon-command
                                       #:pid-file "/does-not-exist"
                                       #:pid-file-timeout 6)
diff --git a/tests/replacement.sh b/tests/replacement.sh
index e06cb93..ba8b2c9 100644
--- a/tests/replacement.sh
+++ b/tests/replacement.sh
@@ -35,8 +35,8 @@ trap "rm -f $socket $conf $rconf $stamp $log;
 cat > "$conf"<<EOF
 (use-modules (srfi srfi-26))
 (register-services
- (make <service>
-   #:provides '(test)
+ (service
+   '(test)
    #:start (const #t)
    #:actions (make-actions
               (say-hello (lambda _
@@ -60,8 +60,8 @@ fi
 
 cat > "$rconf"<<EOF
 (register-services
- (make <service>
-   #:provides '(test)
+ (service
+   '(test)
    #:start (const #t)
    #:actions (make-actions
               (say-goodbye (lambda _
diff --git a/tests/respawn-throttling.sh b/tests/respawn-throttling.sh
index 0dd3ec3..c65762e 100644
--- a/tests/respawn-throttling.sh
+++ b/tests/respawn-throttling.sh
@@ -32,8 +32,8 @@ trap "cat $log || true ;
 
 cat > "$conf"<<EOF
 (register-services
- (make <service>
-   #:provides '(keeps-respawning)
+ (service
+   '(keeps-respawning)
    #:start (make-forkexec-constructor '("false"))
    #:stop  (make-kill-destructor)
    #:respawn? #t))
diff --git a/tests/respawn.sh b/tests/respawn.sh
index ebc298d..d9892ef 100644
--- a/tests/respawn.sh
+++ b/tests/respawn.sh
@@ -63,15 +63,15 @@ function assert_killed_service_is_respawned
 
 cat > "$conf"<<EOF
 (register-services
- (make <service>
-   #:provides '(test1)
+ (service
+   '(test1)
    #:start (make-forkexec-constructor
            '("$SHELL" "-c"
              "echo \$\$ > $PWD/$service1_pid ; while true ; do sleep 1 ; 
done"))
    #:stop  (make-kill-destructor)
    #:respawn? #t)
- (make <service>
-   #:provides '(test2)
+ (service
+   '(test2)
    #:start (make-forkexec-constructor
             ;; The 'sleep' below is just to make it more likely
             ;; that synchronization issues in handling #:pid-file
diff --git a/tests/restart.sh b/tests/restart.sh
index 92a1f79..97649e5 100644
--- a/tests/restart.sh
+++ b/tests/restart.sh
@@ -33,18 +33,18 @@ trap "cat $log || true ;
 
 cat > "$conf"<<EOF
 (register-services
- (make <service>
-   #:provides '(test1)
+ (service
+   '(test1)
    #:start (const #t)
    #:stop  (const #t))
- (make <service>
-   #:provides '(test2)
-   #:requires '(test1)
+ (service
+   '(test2)
+   #:requirement '(test1)
    #:start (const #t)
    #:stop  (const #t))
- (make <service>
-   #:provides '(test3)
-   #:requires '(test2)
+ (service
+   '(test3)
+   #:requirement '(test2)
    #:start (const #t)
    #:stop  (const #t)))
 EOF
diff --git a/tests/signals.sh b/tests/signals.sh
index acb254a..cd25bd3 100644
--- a/tests/signals.sh
+++ b/tests/signals.sh
@@ -34,8 +34,8 @@ trap "rm -f $socket $conf $stamp $log;
 cat > "$conf"<<EOF
 (use-modules (srfi srfi-26))
 (register-services
- (make <service>
-   #:provides '(test)
+ (service
+   '(test)
    #:start (const #t)
    #:stop  (lambda _
              (call-with-output-file "$stamp"
diff --git a/tests/starting-status.sh b/tests/starting-status.sh
index 1db1f69..df05933 100644
--- a/tests/starting-status.sh
+++ b/tests/starting-status.sh
@@ -34,8 +34,8 @@ trap "cat $log || true; rm -f $socket $conf $stamp $log;
 
 cat > "$conf" <<EOF
 (register-services
- (make <service>
-   #:provides '(test)
+ (service
+   '(test)
    #:start (lambda _
              (let loop ((n 30))
                (if (or (file-exists? "$stamp") (zero? n))
diff --git a/tests/status-sexp.sh b/tests/status-sexp.sh
index 5c64c6e..7e2f8d9 100644
--- a/tests/status-sexp.sh
+++ b/tests/status-sexp.sh
@@ -31,18 +31,18 @@ trap "rm -f $socket $conf $stamp $log;
 
 cat > "$conf"<<EOF
 (register-services
- (make <service>
-   #:provides '(foo)
+ (service
+   '(foo)
    #:start (const 'abc)
    #:stop  (const #f)
-   #:docstring "Foo!"
+   #:documentation "Foo!"
    #:respawn? #t)
- (make <service>
-   #:provides '(bar)
-   #:requires '(foo)
+ (service
+   '(bar)
+   #:requirement '(foo)
    #:start (const 'up-and-running)
    #:stop  (const #f)
-   #:docstring "Bar!"
+   #:documentation "Bar!"
    #:respawn? #f))
 
 (start 'foo)
diff --git a/tests/stopping-status.sh b/tests/stopping-status.sh
index b8dfff5..e169033 100644
--- a/tests/stopping-status.sh
+++ b/tests/stopping-status.sh
@@ -34,8 +34,8 @@ trap "cat $log || true; rm -f $socket $conf $stamp $log;
 
 cat > "$conf" <<EOF
 (register-services
- (make <service>
-   #:provides '(test)
+ (service
+   '(test)
    #:start (const #t)
    #:stop  (lambda _
              (let loop ((n 30))
diff --git a/tests/system-star.sh b/tests/system-star.sh
index ee87dff..f14a156 100755
--- a/tests/system-star.sh
+++ b/tests/system-star.sh
@@ -34,8 +34,8 @@ script="while [ ! -f $PWD/$stamp ] ; do sleep 0.1 ; done ; 
exit \$(cat $PWD/$sta
 
 cat > "$conf" <<EOF
 (register-services
- (make <service>
-   #:provides '(test)
+ (service
+   '(test)
    #:start (lambda _
              (list 'exit-code
                    (status:exit-val
@@ -44,14 +44,14 @@ cat > "$conf" <<EOF
              (system* "$SHELL" "-c" "echo STOPPING")
              (delete-file "$stamp"))
    #:respawn? #f)
- (make <service>
-   #:provides '(test-command-not-found)
+ (service
+   '(test-command-not-found)
    #:start (lambda _
              (zero? (system* "this command does not exist")))
    #:stop  (const #f)
    #:respawn? #f)
- (make <service>
-   #:provides '(test-with-respawn)
+ (service
+   '(test-with-respawn)
    #:start (make-forkexec-constructor
              (list "$SHELL" "-cex"
                    "[ ! -f $PWD/$stamp ] ; touch $PWD/$stamp ; sleep 60"))
diff --git a/tests/systemd.sh b/tests/systemd.sh
index d5c08a3..3004871 100644
--- a/tests/systemd.sh
+++ b/tests/systemd.sh
@@ -59,13 +59,13 @@ cat > "$conf" <<EOF
   (list (endpoint (make-socket-address AF_UNIX "$service_socket"))))
 
 (register-services
- (make <service>
-   #:provides '(test-systemd-unix)
+ (service
+   '(test-systemd-unix)
    #:start (make-systemd-constructor %command %endpoints)
    #:stop  (make-systemd-destructor)
    #:respawn? #t)
- (make <service>
-   #:provides '(test-systemd-unix-eager)
+ (service
+   '(test-systemd-unix-eager)
    #:start (make-systemd-constructor %command %endpoints
                                      #:lazy-start? #f)
    #:stop  (make-systemd-destructor)))
diff --git a/tests/transient.sh b/tests/transient.sh
index 028fa79..aaa517d 100644
--- a/tests/transient.sh
+++ b/tests/transient.sh
@@ -31,12 +31,12 @@ trap "cat $log || true; rm -f $socket $conf $log;
 
 cat > "$conf"<<EOF
 (register-services
- (make <service>
-   #:provides '(transient-test1)
+ (service
+   '(transient-test1)
    #:start (make-forkexec-constructor '("sleep" "600"))
    #:transient? #t)
- (make <service>
-   #:provides '(transient-test2)
+ (service
+   '(transient-test2)
    #:start (make-forkexec-constructor '("sleep" "600"))
    #:transient? #t))
 EOF



reply via email to

[Prev in Thread] Current Thread [Next in Thread]