Subject: bug#68468: closed (Re: [bug#68468] [PATCH v2] gnu: services: Add respawn-limit and respawn-delay.)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 28 Jan 2024 21:29:02 +0000

Your bug report

#68468: [PATCH] gnu: services: Add respawn-limit and respawn-delay.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
68468: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68468
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#68468] [PATCH v2] gnu: services: Add respawn-limit and respawn-delay.
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Cc: [email-masked], Attila Lendvai <[email-masked]>
Date: Sun, 28 Jan 2024 22:28:37 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

[email-masked] skribis:

> From: Attila Lendvai <[email-masked]>
>
> * gnu/services/shepherd.scm (<shepherd-service>): Add respawn-limit and
> respawn-delay.
> (shepherd-service-file): Emit the two values into the shepherd service
> constructor form.
>
> Change-Id: I54408e8fb4bcc0956d9610771bf5c566fdc2914c

Applied with the tweaks below, thanks!

Ludo’.

diff --git a/doc/guix.texi b/doc/guix.texi
index 6b95ff89e0..9c703da9bc 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -43145,11 +43145,12 @@ Shepherd Services
 
 @item @code{respawn-limit} (default: @code{#f})
 Set a limit on how many times and how frequently a service may be
-restarted by Shepherd before it is disabled.  See @pxref{Defining
-Services,,, shepherd, The GNU Shepherd Manual} for details.
+restarted by Shepherd before it is disabled.  @xref{Defining
+Services,,, shepherd, The GNU Shepherd Manual}, for details.
 
 @item @code{respawn-delay} (default: @code{#f})
-Wait @code{respawn-delay} seconds before restarting a failed service.
+When true, this is the delay in seconds before restarting a failed
+service.
 
 @item @code{start}
 @itemx @code{stop} (default: @code{#~(const #f)})

Subject: [PATCH] gnu: services: Add respawn-limit and respawn-delay.
From: Attila Lendvai <[email-masked]>
To: [email-masked]
Cc: Attila Lendvai <[email-masked]>
Date: Mon, 15 Jan 2024 11:43:47 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/services/shepherd.scm (<shepherd-service>): Add respawn-limit and
respawn-delay.

Change-Id: I54408e8fb4bcc0956d9610771bf5c566fdc2914c
---
 gnu/services/shepherd.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 5ebac129cec..f5bcde721fe 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -55,6 +55,8 @@ (define-module (gnu services shepherd)
             shepherd-service-canonical-name
             shepherd-service-requirement
             shepherd-service-one-shot?
+            shepherd-service-respawn-limit
+            shepherd-service-respawn-delay
             shepherd-service-respawn?
             shepherd-service-start
             shepherd-service-stop
@@ -211,6 +213,10 @@ (define-record-type* <shepherd-service>
                  (default #f))
   (respawn?      shepherd-service-respawn?             ;Boolean
                  (default #t))
+  (respawn-limit shepherd-service-respawn-limit
+                 (default #f))
+  (respawn-delay shepherd-service-respawn-delay
+                 (default #f))
   (start         shepherd-service-start)               ;g-expression (procedure)
   (stop          shepherd-service-stop                 ;g-expression (procedure)
                  (default #~(const #f)))
@@ -309,6 +315,14 @@ (define (shepherd-service-file service)
                        #:one-shot? '#$(shepherd-service-one-shot? service)
 
                        #:respawn? '#$(shepherd-service-respawn? service)
+                       #$@(if (shepherd-service-respawn-limit service)
+                              `(#:respawn-limit
+                                ,(shepherd-service-respawn-limit service))
+                              '())
+                       #$@(if (shepherd-service-respawn-delay service)
+                              `(#:respawn-delay
+                                ,(shepherd-service-respawn-delay service))
+                              '())
                        #:start #$(shepherd-service-start service)
                        #:stop #$(shepherd-service-stop service)
                        #:actions

base-commit: 162d6a2fdd6af13272967c77347a54934ecb45e6
prerequisite-patch-id: 2adcd37ab1f0752ec27a4edabbabe1c65d88f122
-- 
2.41.0