GNU bug report logs - #77045
[PATCH] services: wireguard: Add the shepherd-requirement field.

Previous Next

Package: guix-patches;

Reported by: Sergey Trofimov <sarg <at> sarg.org.ru>

Date: Sun, 16 Mar 2025 07:57:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#77045: closed ([PATCH] services: wireguard: Add the
 shepherd-requirement field.)
Date: Wed, 19 Mar 2025 10:27:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 19 Mar 2025 11:26:15 +0100
with message-id <87zfhhfha0.fsf_-_ <at> gnu.org>
and subject line Re: bug#77045: [PATCH] services: wireguard: Add the shepherd-requirement field.
has caused the debbugs.gnu.org bug report #77045,
regarding [PATCH] services: wireguard: Add the shepherd-requirement field.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
77045: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77045
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Sergey Trofimov <sarg <at> sarg.org.ru>
To: guix-patches <at> gnu.org
Cc: Sergey Trofimov <sarg <at> sarg.org.ru>
Subject: [PATCH] services: wireguard: Add the shepherd-requirement field.
Date: Sun, 16 Mar 2025 08:55:37 +0100
* gnu/services/vpn.scm
(<wireguard-configuration>): Add shepherd-requirement.
(wireguard-shepherd-service): Pass shepherd-requirement.
* doc/guix.texi (VPN Services):[wireguard]: Document it.
---
 doc/guix.texi        | 4 ++++
 gnu/services/vpn.scm | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 883cdc2803..681200e5f9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35711,6 +35711,10 @@ VPN Services
 List of strings or G-expressions.  These are script snippets which will
 be executed after tearing down the interface.
 
+@item @code{shepherd-requirement} (default: @code{'()}) (type: list-of-symbols)
+A list of symbols naming Shepherd services that this service
+will depend on.
+
 @item @code{table} (default: @code{"auto"})
 The routing table to which routes are added, as a string.  There are two
 special values: @code{"off"} that disables the creation of routes
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index 478a0d543e..2b5886c9fa 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -88,6 +88,7 @@ (define-module (gnu services vpn)
             wireguard-configuration-post-up
             wireguard-configuration-pre-down
             wireguard-configuration-post-down
+            wireguard-configuration-shepherd-requirement
             wireguard-configuration-table
             wireguard-configuration-auto-start?
 
@@ -765,6 +766,8 @@ (define-record-type* <wireguard-configuration>
                           (default '()))
   (post-down              wireguard-configuration-post-down ;list of strings
                           (default '()))
+  (shepherd-requirement   wireguard-configuration-shepherd-requirement ; list of symbols
+                          (default '()))
   (table                  wireguard-configuration-table ;string
                           (default "auto"))
   (auto-start?            wireguard-configuration-auto-start? ;boolean
@@ -918,12 +921,12 @@ (define (endpoint-host-names peers)
 
 (define (wireguard-shepherd-service config)
   (match-record config <wireguard-configuration>
-    (wireguard interface)
+    (wireguard interface shepherd-requirement)
     (let ((wg-quick (file-append wireguard "/bin/wg-quick"))
           (auto-start? (wireguard-configuration-auto-start? config))
           (config (wireguard-configuration-file config)))
       (list (shepherd-service
-             (requirement '(networking))
+             (requirement `(networking ,@shepherd-requirement))
              (provision (list (wireguard-service-name interface)))
              (start #~(lambda _
                        (invoke #$wg-quick "up" #$config)))

base-commit: b8024fa1ade69a4f97990f0e3379eef01dfd40c2
prerequisite-patch-id: f9cc903b8048c8c6fde576fbf38ab110263020e3
prerequisite-patch-id: 54f1264dad23a74efa9aa3823350b2ee055bda97
prerequisite-patch-id: 220ddf11addf3a6c7ab3b349077bca6849241556
prerequisite-patch-id: 18f3d7d0a9ed1f267adeb3630b3801a0c179d9ea
-- 
2.48.1



[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
Cc: 77045-done <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: bug#77045: [PATCH] services: wireguard: Add the
 shepherd-requirement field.
Date: Wed, 19 Mar 2025 11:26:15 +0100
Sergey Trofimov <sarg <at> sarg.org.ru> skribis:

> * gnu/services/vpn.scm (<wireguard-configuration>): Add
> shepherd-requirement.
> (wireguard-shepherd-service): Pass shepherd-requirement. Add
> user-processes to requirements.
> * doc/guix.texi (VPN Services):[wireguard]: Document it.
>
> Change-Id: Ia85add5067f6f9e023b8d65d6ce067b98eeb111e

Applied, thanks!


This bug report was last modified 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.