summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorSergey Trofimov <sarg@sarg.org.ru>2025-05-22 08:03:16 +0200
committerLudovic Courtès <ludo@gnu.org>2025-06-05 22:42:13 +0200
commit2ec1469104cf52ad0e91ad164a9f5a3a80fb9743 (patch)
treee29bffa0161d98c3cc1a99b0e1a8e6dc5cc257fb /gnu
parent38756ac03de9c2c70935c2d32a8398117c687ca2 (diff)
services: networking: Add shepherd-requirement for dhcpcd.
* gnu/services/networking.scm (dhcpcd-configuration): Add shepherd-requirement field. (dhcpcd-shepherd-service): Use it. * doc/guix.texi (Networking Setup): Regenerate dhcpcd-configuration documentation. (File Systems): Fix typo. Change-Id: Id347e2bed2569237685a47be82dbf686640db25b Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/networking.scm31
1 files changed, 19 insertions, 12 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 8b7bf668927..40081bf60e4 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -127,6 +127,7 @@
dhcpcd-configuration-vendor-class-id
dhcpcd-configuration-client-id
dhcpcd-configuration-extra-content
+ dhcpcd-configuration-shepherd-requirement
ntp-configuration
ntp-configuration?
@@ -611,6 +612,12 @@ this is matually exclusive with the @code{duid} option.")
maybe-string
"Extra content to append to the configuration as-is.")
+ (shepherd-requirement
+ (list-of-symbols '())
+ "This is a list of symbols naming Shepherd services that this service
+will depend on."
+ empty-serializer)
+
(prefix dhcpcd-))
(define (dhcpcd-config-file config)
@@ -630,19 +637,19 @@ this is matually exclusive with the @code{duid} option.")
(shell (file-append shadow "/sbin/nologin")))))
(define (dhcpcd-shepherd-service config)
- (let* ((config-file (dhcpcd-config-file config))
- (command-args (dhcpcd-configuration-command-arguments config))
- (ifaces (dhcpcd-configuration-interfaces config)))
- (list (shepherd-service
- (documentation "dhcpcd daemon.")
- (provision '(networking))
- (requirement '(user-processes udev))
- (actions (list (shepherd-configuration-action config-file)))
- (start
+ (match-record config <dhcpcd-configuration>
+ (command-arguments interfaces shepherd-requirement)
+ (let ((config-file (dhcpcd-config-file config)))
+ (list (shepherd-service
+ (documentation "dhcpcd daemon.")
+ (provision '(networking))
+ (requirement `(user-processes udev ,@shepherd-requirement))
+ (actions (list (shepherd-configuration-action config-file)))
+ (start
#~(make-forkexec-constructor
- (list (string-append #$dhcpcd "/sbin/dhcpcd")
- #$@command-args "-B" "-f" #$config-file #$@ifaces)))
- (stop #~(make-kill-destructor))))))
+ (list (string-append #$dhcpcd "/sbin/dhcpcd")
+ #$@command-arguments "-B" "-f" #$config-file #$@interfaces)))
+ (stop #~(make-kill-destructor)))))))
(define dhcpcd-service-type
(service-type (name 'dhcpcd)