* [bug#68468] [PATCH] gnu: services: Add respawn-limit and respawn-delay.
@ 2024-01-15 10:43 Attila Lendvai
2024-01-24 22:15 ` Ludovic Courtès
2024-01-25 15:05 ` [bug#68468] [PATCH v2] " attila.lendvai
0 siblings, 2 replies; 4+ messages in thread
From: Attila Lendvai @ 2024-01-15 10:43 UTC (permalink / raw)
To: 68468; +Cc: Attila Lendvai
* 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#68468] [PATCH] gnu: services: Add respawn-limit and respawn-delay.
2024-01-15 10:43 [bug#68468] [PATCH] gnu: services: Add respawn-limit and respawn-delay Attila Lendvai
@ 2024-01-24 22:15 ` Ludovic Courtès
2024-01-25 15:05 ` [bug#68468] [PATCH v2] " attila.lendvai
1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2024-01-24 22:15 UTC (permalink / raw)
To: Attila Lendvai; +Cc: Attila Lendvai, 68468
Hi,
Attila Lendvai <attila.lendvai@gmail.com> skribis:
> * gnu/services/shepherd.scm (<shepherd-service>): Add respawn-limit and
> respawn-delay.
>
> Change-Id: I54408e8fb4bcc0956d9610771bf5c566fdc2914c
Neat! Please also mention the changes in ‘shepherd-service-file’.
> + (respawn-limit shepherd-service-respawn-limit
> + (default #f))
> + (respawn-delay shepherd-service-respawn-delay
> + (default #f))
Could you document them in ‘doc/guix.texi’?
> + #$@(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))
> + '())
In theory, we could end up loading code that uses #:respawn-limit in a
running shepherd that does not support it (too old). To properly
address that, we’d need to check what shepherd version we’re talking to.
But… I think we can ignore this issue, as long as we don’t use it in
gnu/services/*.scm until some time has passed.
Thanks!
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [bug#68468] [PATCH v2] gnu: services: Add respawn-limit and respawn-delay.
2024-01-15 10:43 [bug#68468] [PATCH] gnu: services: Add respawn-limit and respawn-delay Attila Lendvai
2024-01-24 22:15 ` Ludovic Courtès
@ 2024-01-25 15:05 ` attila.lendvai
2024-01-28 21:28 ` bug#68468: " Ludovic Courtès
1 sibling, 1 reply; 4+ messages in thread
From: attila.lendvai @ 2024-01-25 15:05 UTC (permalink / raw)
To: 68468; +Cc: Attila Lendvai
From: Attila Lendvai <attila@lendvai.name>
* 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
---
doc/guix.texi | 8 ++++++++
gnu/services/shepherd.scm | 14 ++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/doc/guix.texi b/doc/guix.texi
index a66005ee9db..9f911643352 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -42888,6 +42888,14 @@ Shepherd Services
Whether to restart the service when it stops, for instance when the
underlying process dies.
+@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.
+
+@item @code{respawn-delay} (default: @code{#f})
+Wait @code{respawn-delay} seconds before restarting a failed service.
+
@item @code{start}
@itemx @code{stop} (default: @code{#~(const #f)})
The @code{start} and @code{stop} fields refer to the Shepherd's
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#68468: [PATCH v2] gnu: services: Add respawn-limit and respawn-delay.
2024-01-25 15:05 ` [bug#68468] [PATCH v2] " attila.lendvai
@ 2024-01-28 21:28 ` Ludovic Courtès
0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2024-01-28 21:28 UTC (permalink / raw)
To: attila.lendvai; +Cc: 68468-done, Attila Lendvai
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
Hi,
attila.lendvai@gmail.com skribis:
> From: Attila Lendvai <attila@lendvai.name>
>
> * 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’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 806 bytes --]
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)})
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-28 21:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-15 10:43 [bug#68468] [PATCH] gnu: services: Add respawn-limit and respawn-delay Attila Lendvai
2024-01-24 22:15 ` Ludovic Courtès
2024-01-25 15:05 ` [bug#68468] [PATCH v2] " attila.lendvai
2024-01-28 21:28 ` bug#68468: " Ludovic Courtès
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.