all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#62770] [PATCH] services: dhcp-client-configuration: Add 'shepherd-requirement' field.
@ 2023-04-11  7:33 Sergey Trofimov
  2023-05-11 12:35 ` bug#62770: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Trofimov @ 2023-04-11  7:33 UTC (permalink / raw)
  To: 62770; +Cc: Sergey Trofimov

* gnu/services/networking.scm (<dhcp-client-configuration>)
[shepherd-requirement]: New field.
(dhcp-client-shepherd-service): Honor it.
(dhcp-client-configuration-shepherd-requirement): Export accessor.
* doc/guix.texi (Networking Setup): Document it.
---
 doc/guix.texi               | 8 +++++++-
 gnu/services/networking.scm | 6 +++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ac60acf98c..25f06fd0a8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19892,6 +19892,12 @@ should listen on---e.g., @code{'("eno1")}.
 When set to @code{'all}, the DHCP client listens on all the available
 non-loopback interfaces that can be activated.  Otherwise the DHCP
 client listens only on the specified interfaces.
+
+@item @code{shepherd-requirement} (default: @code{'()})
+This option can be used to provide a list of symbols naming Shepherd services
+that this service will depend on, such as @code{'wpa-supplicant} or
+@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet
+networks.
 @end table
 @end deftp
 
@@ -19995,7 +20001,7 @@ Data Type representing the configuration of connman.
 @item @code{connman} (default: @var{connman})
 The connman package to use.
 
-@item @code{shepherd-requirement} (default: @code{()})
+@item @code{shepherd-requirement} (default: @code{'()})
 This option can be used to provide a list of symbols naming Shepherd services
 that this service will depend on, such as @code{'wpa-supplicant} or
 @code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 19c109d238..1b2e6a8c53 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -89,6 +89,7 @@ (define-module (gnu services networking)
             dhcp-client-configuration?
             dhcp-client-configuration-package
             dhcp-client-configuration-interfaces
+            dhcp-client-configuration-shepherd-requirement
 
             dhcpd-service-type
             dhcpd-configuration
@@ -279,6 +280,8 @@ (define-record-type* <dhcp-client-configuration>
   dhcp-client-configuration?
   (package      dhcp-client-configuration-package ;file-like
                 (default isc-dhcp))
+  (shepherd-requirement dhcp-client-configuration-shepherd-requirement
+                        (default '()))
   (interfaces   dhcp-client-configuration-interfaces
                 (default 'all)))                  ;'all | list of strings
 
@@ -286,11 +289,12 @@ (define dhcp-client-shepherd-service
   (match-lambda
     ((? dhcp-client-configuration? config)
      (let ((package (dhcp-client-configuration-package config))
+           (shepherd-requirement (dhcp-client-configuration-shepherd-requirement config))
            (interfaces (dhcp-client-configuration-interfaces config))
            (pid-file "/var/run/dhclient.pid"))
        (list (shepherd-service
               (documentation "Set up networking via DHCP.")
-              (requirement '(user-processes udev))
+              (requirement `(user-processes udev ,@shepherd-requirement))
 
               ;; XXX: Running with '-nw' ("no wait") avoids blocking for a minute when
               ;; networking is unavailable, but also means that the interface is not up
-- 
2.39.2





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#62770: [PATCH] services: dhcp-client-configuration: Add 'shepherd-requirement' field.
  2023-04-11  7:33 [bug#62770] [PATCH] services: dhcp-client-configuration: Add 'shepherd-requirement' field Sergey Trofimov
@ 2023-05-11 12:35 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2023-05-11 12:35 UTC (permalink / raw)
  To: Sergey Trofimov; +Cc: 62770-done

Hi,

Sergey Trofimov <sarg@sarg.org.ru> skribis:

> * gnu/services/networking.scm (<dhcp-client-configuration>)
> [shepherd-requirement]: New field.
> (dhcp-client-shepherd-service): Honor it.
> (dhcp-client-configuration-shepherd-requirement): Export accessor.
> * doc/guix.texi (Networking Setup): Document it.

Applied, thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-11 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-11  7:33 [bug#62770] [PATCH] services: dhcp-client-configuration: Add 'shepherd-requirement' field Sergey Trofimov
2023-05-11 12:35 ` bug#62770: " 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.