all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila.lendvai@gmail.com>
To: 68468@debbugs.gnu.org
Cc: Attila Lendvai <attila@lendvai.name>
Subject: [bug#68468] [PATCH] gnu: services: Add respawn-limit and respawn-delay.
Date: Mon, 15 Jan 2024 11:43:47 +0100	[thread overview]
Message-ID: <288643093baa2855c7b5f8cf1d9f6da2b378f965.1705315426.git.attila@lendvai.name> (raw)

* 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





             reply	other threads:[~2024-01-15 10:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 10:43 Attila Lendvai [this message]
2024-01-24 22:15 ` [bug#68468] [PATCH] gnu: services: Add respawn-limit and respawn-delay Ludovic Courtès
2024-01-25 15:05 ` [bug#68468] [PATCH v2] " attila.lendvai
2024-01-28 21:28   ` bug#68468: " 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=288643093baa2855c7b5f8cf1d9f6da2b378f965.1705315426.git.attila@lendvai.name \
    --to=attila.lendvai@gmail.com \
    --cc=68468@debbugs.gnu.org \
    --cc=attila@lendvai.name \
    /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.