From unknown Sat Aug 16 16:06:23 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#75934 <75934@debbugs.gnu.org> To: bug#75934 <75934@debbugs.gnu.org> Subject: Status: [PATCH] services: networking: Add dhcpcd service. Reply-To: bug#75934 <75934@debbugs.gnu.org> Date: Sat, 16 Aug 2025 23:06:23 +0000 retitle 75934 [PATCH] services: networking: Add dhcpcd service. reassign 75934 guix-patches submitter 75934 soeren@soeren-tempel.net severity 75934 normal tag 75934 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 29 15:50:08 2025 Received: (at submit) by debbugs.gnu.org; 29 Jan 2025 20:50:08 +0000 Received: from localhost ([127.0.0.1]:43220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tdF0h-0004lc-6O for submit@debbugs.gnu.org; Wed, 29 Jan 2025 15:50:08 -0500 Received: from lists.gnu.org ([2001:470:142::17]:47926) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tdF0e-0004hq-TC for submit@debbugs.gnu.org; Wed, 29 Jan 2025 15:50:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tdF0W-0007Ul-37 for guix-patches@gnu.org; Wed, 29 Jan 2025 15:49:56 -0500 Received: from magnesium.8pit.net ([45.76.88.171]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tdF0S-0003eP-Up; Wed, 29 Jan 2025 15:49:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=opensmtpd; bh=X0rPmiLP fRov5Hm5xmQhGyDP4qUWOn+X9+BLXXt8UDE=; h=date:subject:cc:to:from; d=soeren-tempel.net; b=yMeR2iJUwDsXKrBxcrTRkasiGSAA0p1ZlfCGHDIpXv70bLj KyW6mIUnjvo0AviqyNdPJ6JJIPVXqTwmF9Giy0xn0lT1FGg9gPXwY/x+AGYIY/gqM1uI2X X1iV5TkRyg6dvIJywiHlFozFDKjgG3DsT/vCjyJTunQpsNxG9wfao8= Received: from localhost ( [2a02:560:4df5:8100:913b:aeab:e36:2b15]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 4dd72325 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Wed, 29 Jan 2025 21:49:43 +0100 (CET) From: soeren@soeren-tempel.net To: guix-patches@gnu.org Subject: [PATCH] services: networking: Add dhcpcd service. Date: Wed, 29 Jan 2025 21:45:22 +0100 Message-ID: <20250129204935.2331-1-soeren@soeren-tempel.net> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-Debbugs-Cc: ludo@gnu.org, 873216071@qq.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=45.76.88.171; envelope-from=soeren@soeren-tempel.net; helo=magnesium.8pit.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: Quelln@protonmail.com, ludo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) From: Sören Tempel This is intended as an alternative to dhcp-client-service-type as isc-dhcp has reached its end-of-life in 2022 (three years ago!), see #68619 for more details. Long-term, this services is therefore intended to replace dhcp-client-service-type. * gnu/services/networking.scm (dhcpcd-service-type): New service. (dhcpcd-shepherd-service): New procedure. (dhcpcd-account-service): New variable. (dhcpcd-config-file): New procedure. (dhcpcd-configuration): New record type. (dhcpcd-serialize-list-of-strings, dhcpcd-serialize-boolean) (dhcpcd-serialize-string): New procedures. * gnu/tests/networking.scm (run-dhcpcd-test): New procedure. (%dhcpcd-os, %test-dhcpcd): New variables. * doc/guix.texi (Networking Services): Document it. --- Previously, an integration into the dhcp-client-service-type was attempted. However, the discussion there established that a new entirely separate service would be a better fit. See https://issues.guix.gnu.org/68675 for the prior discussion. doc/guix.texi | 57 ++++++++++++++ gnu/services/networking.scm | 147 ++++++++++++++++++++++++++++++++++++ gnu/tests/networking.scm | 106 ++++++++++++++++++++++++++ 3 files changed, 310 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index b1b6d98e74..6f51d1e1f6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21468,6 +21468,63 @@ which provides the @code{networking} Shepherd service. @end table @end deftp +@cindex DHCPCD, networking service + +@defvar dhcpcd-service-type +This is a service which runs @var{dhcpcd}, an alternative Dynamic +Host Configuration Protocol (DHCP) client. +@end defvar + +@deftp {Data Type} dhcpcd-configuration +Available @code{dhcpcd-configuration} fields are: + +@table @asis +@item @code{interfaces} (default: @code{()}) (type: list) +List of interfaces to start a DHCP client for. + +@item @code{command-args} (default: @code{("-q" "-q")}) (type: list) +List of additional command-line options. + +@item @code{hostname} (default: @code{""}) (type: maybe-string) +Hostname to send via DHCP, defaults to the current system hostname. + +@item @code{duid} (default: @code{""}) (type: maybe-string) +Use and generate a DHCP Unique Identifier. + +@item @code{persistent} (default: @code{#t}) (type: boolean) +Do not de-configure on shutdown. + +@item @code{option} (default: @code{("rapid_commit" "domain_name_servers" "domain_name" "domain_search" "host_name" "classless_static_routes" "interface_mtu")}) (type: list-of-strings) +List of options to request from the server. + +@item @code{require} (default: @code{("dhcp_server_identifier")}) (type: list-of-strings) +List of options to require in responses. + +@item @code{slaac} (default: @code{"private"}) (type: maybe-string) +Interface identifier used for SLAAC generated IPv6 addresses. + +@item @code{nooption} (default: @code{()}) (type: list-of-strings) +List of options to remove from the message before it's processed. + +@item @code{nohook} (default: @code{()}) (type: list-of-strings) +List of hook script which should not be invoked. + +@item @code{static} (default: @code{()}) (type: list-of-strings) +Configure a static value (e.g. ip_address). + +@item @code{vendorclassid} (type: maybe-string) +Set the DHCP Vendor Class. + +@item @code{clientid} (type: maybe-string) +Use the interface hardware address or the given string as a Client ID. + +@item @code{extra-content} (type: maybe-string) +Extra content to append to the configuration as-is. + +@end table +@end deftp + + @cindex NetworkManager @defvar network-manager-service-type diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index af28bd0626..c97d50eccf 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -108,6 +108,24 @@ (define-module (gnu services networking) dhcpd-configuration-pid-file dhcpd-configuration-interfaces + dhcpcd-service-type + dhcpcd-configuration + dhcpcd-configuration? + dhcpcd-configuration-interfaces + dhcpcd-configuration-command-args + dhcpcd-configuration-hostname + dhcpcd-configuration-duid + dhcpcd-configuration-persistent + dhcpcd-configuration-option + dhcpcd-configuration-require + dhcpcd-configuration-slaac + dhcpcd-configuration-nooption + dhcpcd-configuration-nohook + dhcpcd-configuration-static + dhcpcd-configuration-vendorclassid + dhcpcd-configuration-clientid + dhcpcd-configuration-extra-content + ntp-configuration ntp-configuration? ntp-configuration-ntp @@ -491,6 +509,135 @@ (define dhcpd-service-type (description "Run a DHCP (Dynamic Host Configuration Protocol) daemon. The daemon is responsible for allocating IP addresses to its client."))) + +;; +;; DHCPCD. +;; + +(define (dhcpcd-serialize-string field-name value) + (let ((field (object->string field-name))) + (if (string=? field "extra-content") + #~(string-append #$value "\n") + #~(format #f "~a ~a~%" #$field #$value)))) + +(define (dhcpcd-serialize-boolean field-name value) + (if value + #~(format #f "~a~%" #$(object->string field-name)) + "")) + +(define (dhcpcd-serialize-list-of-strings field-name value) + #~(string-append #$@(map (cut dhcpcd-serialize-string field-name <>) value))) + +;; Some fields (e.g. hostname) can be specified with an empty string argument. +;; Therefore, we need a maybe type to differentiate disabled/empty-string. +(define-maybe string (prefix dhcpcd-)) + +(define-configuration dhcpcd-configuration + (interfaces + (list '()) + "List of interfaces to start a DHCP client for." + empty-serializer) + (command-args + (list '("-q" "-q")) + "List of additional command-line options." + empty-serializer) + + ;; The following defaults replicate the default dhcpcd configuration file. + ;; + ;; See https://github.com/NetworkConfiguration/dhcpcd/tree/v10.0.10#configuration + (hostname + (maybe-string "") + "Hostname to send via DHCP, defaults to the current system hostname.") + (duid + (maybe-string "") + "Use and generate a DHCP Unique Identifier.") + (persistent + (boolean #t) + "Do not de-configure on shutdown.") + (option + (list-of-strings + '("rapid_commit" + "domain_name_servers" + "domain_name" + "domain_search" + "host_name" + "classless_static_routes" + "interface_mtu")) + "List of options to request from the server.") + (require + (list-of-strings '("dhcp_server_identifier")) + "List of options to require in responses.") + (slaac + (maybe-string "private") + "Interface identifier used for SLAAC generated IPv6 addresses.") + + ;; Common options not set in the default configuration file. + (nooption + (list-of-strings '()) + "List of options to remove from the message before it's processed.") + (nohook + (list-of-strings '()) + "List of hook script which should not be invoked.") + (static + (list-of-strings '()) + "Configure a static value (e.g. ip_address).") + (vendorclassid + maybe-string + "Set the DHCP Vendor Class.") + (clientid + maybe-string + "Use the interface hardware address or the given string as a Client ID.") + + ;; Escape hatch for the generated configuration file. + (extra-content + maybe-string + "Extra content to append to the configuration as-is.") + + (prefix dhcpcd-)) + +(define (dhcpcd-config-file config) + (mixed-text-file "dhcpcd.conf" + (serialize-configuration + config + dhcpcd-configuration-fields))) + +(define dhcpcd-account-service + (list (user-group (name "dhcpcd") (system? #t)) + (user-account + (name "dhcpcd") + (group "dhcpcd") + (system? #t) + (comment "dhcpcd daemon user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define (dhcpcd-shepherd-service config) + (let* ((config-file (dhcpcd-config-file config)) + (command-args (dhcpcd-configuration-command-args 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 + #~(lambda _ + (fork+exec-command + (list (string-append #$dhcpcd "/sbin/dhcpcd") + #$@command-args "-B" "-f" #$config-file #$@ifaces)))) + (stop #~(make-kill-destructor)))))) + +(define dhcpcd-service-type + (service-type (name 'dhcpcd) + (description "Run the dhcpcd daemon.") + (extensions + (list (service-extension account-service-type + (const dhcpcd-account-service)) + (service-extension shepherd-root-service-type + dhcpcd-shepherd-service))) + (compose concatenate) + (default-value (dhcpcd-configuration)))) + ;;; ;;; NTP. diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index e7c02b9e00..720f123953 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -32,6 +32,7 @@ (define-module (gnu tests networking) #:use-module (guix store) #:use-module (guix monads) #:use-module (guix modules) + #:use-module (gnu packages admin) #:use-module (gnu packages bash) #:use-module (gnu packages linux) #:use-module (gnu packages networking) @@ -44,6 +45,7 @@ (define-module (gnu tests networking) %test-inetd %test-openvswitch %test-dhcpd + %test-dhcpcd %test-tor %test-iptables %test-ipfs)) @@ -673,6 +675,110 @@ (define %test-dhcpd (description "Test a running DHCP daemon configuration.") (value (run-dhcpd-test)))) + +;;; +;;; DHCPCD Daemon +;;; + +(define %dhcpcd-os + (let ((base-os + (simple-operating-system + (service dhcpcd-service-type + (dhcpcd-configuration + (command-args '("--debug" "--logfile" "/dev/console")) + (interfaces '("ens3"))))))) + (operating-system + (inherit base-os) + (packages + (append (list dhcpcd iproute) + (operating-system-packages base-os)))))) + +(define (run-dhcpcd-test) + "Run tests in %dhcpcd-os with a running dhcpcd daemon on localhost." + (define os + (marionette-operating-system + %dhcpcd-os + #:imported-modules '((gnu services herd)))) + + (define vm + (virtual-machine os)) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-64) + (gnu build marionette)) + (define marionette + (make-marionette (list #$vm))) + + (define (wait-for-lease) + (marionette-eval + '(begin + (use-modules (ice-9 popen) (ice-9 rdelim)) + + (let loop ((i 15)) + (if (> i 0) + (let* ((port (open-input-pipe "dhcpcd --dumplease ens3")) + (output (read-string port))) + (close-port port) + (unless (string-contains output "reason=BOUND") + (sleep 1) + (loop (- i 1)))) + (error "failed to obtain a DHCP lease")))) + marionette)) + + (test-runner-current (system-test-runner #$output)) + (test-begin "dhcpcd") + + (test-assert "service is running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + + ;; Make sure the 'dhcpcd' command is found. + (setenv "PATH" "/run/current-system/profile/sbin") + + (wait-for-service 'networking)) + marionette)) + + (test-assert "IPC socket exists" + (marionette-eval + '(file-exists? "/var/run/dhcpcd/ens3.sock") + marionette)) + + (test-equal "IPC is functional" + 0 + (marionette-eval + '(status:exit-val + (system* "dhcpcd" "--dumplease" "ens3")) + marionette)) + + (test-equal "aquires IPv4 address via DHCP" + 1 + (and + (wait-for-lease) + (marionette-eval + '(begin + (use-modules (ice-9 popen) (ice-9 rdelim)) + + (let* ((port (open-input-pipe "ip -4 address show dev ens3")) + (lines (string-split (read-string port) #\newline))) + (close-port port) + (length + (filter (lambda (line) + (string-contains line "scope global dynamic")) + lines)))) + marionette))) + + (test-end)))) + (gexp->derivation "dhcpcd-test" test)) + +(define %test-dhcpcd + (system-test + (name "dhcpcd") + (description "Test that the dhcpcd obtains IP DHCP leases.") + (value (run-dhcpcd-test)))) + ;;; ;;; Services related to Tor From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 13:29:14 2025 Received: (at 75934) by debbugs.gnu.org; 5 Mar 2025 18:29:14 +0000 Received: from localhost ([127.0.0.1]:39797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tptUY-00073X-Am for submit@debbugs.gnu.org; Wed, 05 Mar 2025 13:29:14 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:45328) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tptUV-00073H-6F for 75934@debbugs.gnu.org; Wed, 05 Mar 2025 13:29:12 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id A189F68D; Wed, 5 Mar 2025 19:29:03 +0100 (CET) Authentication-Results: hera.aquilenet.fr; none X-Virus-Scanned: Debian amavis at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP id AVPKLJDi6FPa; Wed, 5 Mar 2025 19:29:02 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 32BB22A0; Wed, 5 Mar 2025 19:29:01 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: soeren@soeren-tempel.net Subject: Re: [bug#75934] [PATCH] services: networking: Add dhcpcd service. In-Reply-To: <20250129204935.2331-1-soeren@soeren-tempel.net> (soeren@soeren-tempel.net's message of "Wed, 29 Jan 2025 21:45:22 +0100") References: <20250129204935.2331-1-soeren@soeren-tempel.net> Date: Wed, 05 Mar 2025 19:29:00 +0100 Message-ID: <87eczbz5zn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: hera X-Rspamd-Queue-Id: A189F68D X-Spamd-Result: default: False [4.90 / 15.00]; SPAM_FLAG(5.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_SPAM(3.00)[1.000]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[protonmail.com,qq.com]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_CC(0.00)[debbugs.gnu.org,protonmail.com,qq.com] X-Spamd-Bar: ++++ X-Rspamd-Action: no action X-Spam-Level: **** X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 75934 Cc: Quelln@protonmail.com, 873216071@qq.com, 75934@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, soeren@soeren-tempel.net skribis: > From: S=C3=B6ren Tempel > > This is intended as an alternative to dhcp-client-service-type as > isc-dhcp has reached its end-of-life in 2022 (three years ago!), > see #68619 for more details. Long-term, this services is therefore > intended to replace dhcp-client-service-type. > > * gnu/services/networking.scm (dhcpcd-service-type): New service. > (dhcpcd-shepherd-service): New procedure. > (dhcpcd-account-service): New variable. > (dhcpcd-config-file): New procedure. > (dhcpcd-configuration): New record type. > (dhcpcd-serialize-list-of-strings, dhcpcd-serialize-boolean) > (dhcpcd-serialize-string): New procedures. > * gnu/tests/networking.scm (run-dhcpcd-test): New procedure. > (%dhcpcd-os, %test-dhcpcd): New variables. > * doc/guix.texi (Networking Services): Document it. > --- > Previously, an integration into the dhcp-client-service-type was > attempted. However, the discussion there established that a new > entirely separate service would be a better fit. > > See https://issues.guix.gnu.org/68675 for the prior discussion. Nice, thanks for working on it. Overall LGTM. Some rather minor suggestions below: > +@cindex DHCPCD, networking service > + > +@defvar dhcpcd-service-type > +This is a service which runs @var{dhcpcd}, an alternative Dynamic > +Host Configuration Protocol (DHCP) client. > +@end defvar What about something like this, to provide more context: This the type for a service running @command{dhcpcd}, a @acronym{DHCP, Dynamic Host Configuration Protocol} client that can be used as a replacement for the historical ISC client supported by @code{dhcp-client-service-type}. Its value must be a @code{dhcpcd-configuration} record, as described below. > +(define (dhcpcd-serialize-string field-name value) > + (let ((field (object->string field-name))) > + (if (string=3D? field "extra-content") > + #~(string-append #$value "\n") > + #~(format #f "~a ~a~%" #$field #$value)))) Please indent =E2=80=98if=E2=80=99 expressions like this: (if condition then else) > +(define-configuration dhcpcd-configuration > + (interfaces > + (list '()) > + "List of interfaces to start a DHCP client for." =E2=80=9CList of networking interfaces---e.g., @code{\"eth0\"}---to start = =E2=80=A6=E2=80=9D Perhaps also explain what happens when it=E2=80=99s the empty list. > + (command-args s/command-args/command-arguments/ > + (list '("-q" "-q")) Twice? > + (hostname > + (maybe-string "") > + "Hostname to send via DHCP, defaults to the current system hostname.= ") Rather =E2=80=98host-name=E2=80=99 and =E2=80=9CHost name=E2=80=9D. :-) > + (duid > + (maybe-string "") > + "Use and generate a DHCP Unique Identifier.") This isn=E2=80=99t clear to me; make sure to describe what the value repres= ents. > + (persistent > + (boolean #t) > + "Do not de-configure on shutdown.") Rather =E2=80=98persistent?=E2=80=99 (question mark), and perhaps something= like: =E2=80=9CWhen true, preserve configuration on disk when shutting down and reuse it when restarting.=E2=80=9D > + ;; Common options not set in the default configuration file. > + (nooption > + (list-of-strings '()) > + "List of options to remove from the message before it's processed.") > + (nohook > + (list-of-strings '()) > + "List of hook script which should not be invoked.") =E2=80=98excluded-options=E2=80=99, =E2=80=98excluded-hooks=E2=80=99 maybe? > + (static > + (list-of-strings '()) > + "Configure a static value (e.g. ip_address).") =E2=80=98static-values=E2=80=99? An example would be welcome. > + (vendorclassid > + maybe-string > + "Set the DHCP Vendor Class.") > + (clientid > + maybe-string > + "Use the interface hardware address or the given string as a Client = ID.") =E2=80=98vendor-class-id=E2=80=99, =E2=80=98client-id=E2=80=99, but again w= ith examples probably. > + (actions (list (shepherd-configuration-action config-file))) > + (start > + #~(lambda _ > + (fork+exec-command > + (list (string-append #$dhcpcd "/sbin/dhcpcd") > + #$@command-args "-B" "-f" #$config-file #$@ifa= ces)))) Rather: (start #~(make-forkexec-constructor (list =E2=80=A6))) The system test is pretty nice! Could you send an updated version? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 07 09:32:10 2025 Received: (at 75934) by debbugs.gnu.org; 7 Mar 2025 14:32:10 +0000 Received: from localhost ([127.0.0.1]:47585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tqYkC-0004xY-Sh for submit@debbugs.gnu.org; Fri, 07 Mar 2025 09:32:09 -0500 Received: from magnesium.8pit.net ([2001:19f0:6c01:4ae:5400:ff:fe66:af9d]:12580) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tqYjj-0004wH-5g; Fri, 07 Mar 2025 09:31:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=opensmtpd; bh=iUpbWAmN EPZ0Ft9LYBmfxbR7IAPR1q0wvzNLBJtEgn8=; h=date:subject:cc:to:from; d=soeren-tempel.net; b=VYrS65tUUMjTk48PYefnu67zskUyFlaepECQkdb69hZ5fio zg/xtyCBLi91TnG/96czm+f2JQDllZt9HyMnaCujy1BVtQj2A3kgce6FyXpflQO59LflxA xd8GvKxHcwwOIcQS2yNRfUo2b6zjo2yBLGypJv0XnxO+5GKMN5H474= Received: from localhost ( [2a02:560:4d83:4d00:581f:35a1:9dc3:d0ba]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 120462f3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Fri, 7 Mar 2025 15:31:34 +0100 (CET) From: soeren@soeren-tempel.net To: 75934@debbugs.gnu.org Subject: [PATCH v2] services: networking: Add dhcpcd service. Date: Fri, 7 Mar 2025 15:29:05 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75934 Cc: ludo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) From: Sören Tempel This is intended as an alternative to dhcp-client-service-type as isc-dhcp has reached its end-of-life in 2022 (three years ago!), see #68619 for more details. Long-term, this services is therefore intended to replace dhcp-client-service-type. * gnu/services/networking.scm (dhcpcd-service-type): New service. (dhcpcd-shepherd-service): New procedure. (dhcpcd-account-service): New variable. (dhcpcd-config-file): New procedure. (dhcpcd-configuration): New record type. (dhcpcd-serialize-list-of-strings, dhcpcd-serialize-boolean) (dhcpcd-serialize-string): New procedures. (serialize-field-name): New procedure. * gnu/tests/networking.scm (run-dhcpcd-test): New procedure. (%dhcpcd-os, %test-dhcpcd): New variables. * doc/guix.texi (Networking Services): Document it. --- Change since v1: * Expand documentation and include a larger configuration example * Improve record type by hyphening record field names * Use make-forkexec-constructor in shepherd service * Fix indention of if expression doc/guix.texi | 89 ++++++++++++++++++++ gnu/services/networking.scm | 161 ++++++++++++++++++++++++++++++++++++ gnu/tests/networking.scm | 106 ++++++++++++++++++++++++ 3 files changed, 356 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 6844470ce2..6529865c09 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21594,6 +21594,95 @@ Networking Setup @end table @end deftp +@cindex DHCPCD, networking service + +@defvar dhcpcd-service-type +This the type for a service running @command{dhcpcd}, a @acronym{DHCP, +Dynamic Host Configuration Protocol} client that can be used as a +replacement for the historical ISC client supported by +@code{dhcp-client-service-type}. + +Its value must be a @code{dhcpcd-configuration} record, as described +below. As an example, consider the following setup which runs +@command{dhcpcd} with a local @acronym{DNS, Domain Name System} +resolver: + +@lisp +(service dhcpcd-service-type + (dhcpcd-configuration + (option '("rapid_commit" "interface_mtu")) + (no-option '("nd_rdnss" + "dhcp6_name_servers" + "domain_name_servers" + "domain_name" + "domain_search")) + (static '("domain_name_servers=127.0.0.1")) + (no-hook '("hostname"))))) +@end lisp +@end defvar + +@deftp {Data Type} dhcpcd-configuration +Available @code{dhcpcd-configuration} fields are: + +@table @asis +@item @code{interfaces} (default: @code{()}) (type: list) +List of networking interfaces---e.g., @code{"eth0"}---to start a DHCP +client for. If no interface is specified (i.e., the list is empty) then +@command{dhcpcd} discovers available Ethernet interfaces, that can be +configured, automatically. + +@item @code{command-arguments} (default: @code{("-q" "-q")}) (type: list) +List of additional command-line options. + +@item @code{host-name} (default: @code{""}) (type: maybe-string) +Host name to send via DHCP, defaults to the current system host name. + +@item @code{duid} (default: @code{""}) (type: maybe-string) +DHCPv4 clients require a unique client identifier, this option uses the +DHCPv6 Unique Identifier as a DHCPv4 client identifier as well. For +more information, refer to @uref{https://www.rfc-editor.org/rfc/rfc4361, RFC 4361} +and @code{dhcpcd.conf(5)}. + +@item @code{persistent?} (default: @code{#t}) (type: boolean) +When true, automatically de-configure the interface when @command{dhcpcd} +exits. + +@item @code{option} (default: @code{("rapid_commit" "domain_name_servers" "domain_name" "domain_search" "host_name" "classless_static_routes" "interface_mtu")}) (type: list-of-strings) +List of options to request from the server. + +@item @code{require} (default: @code{("dhcp_server_identifier")}) (type: list-of-strings) +List of options to require in responses. + +@item @code{slaac} (default: @code{"private"}) (type: maybe-string) +Interface identifier used for SLAAC generated IPv6 addresses. + +@item @code{no-option} (default: @code{()}) (type: list-of-strings) +List of options to remove from the message before it's processed. + +@item @code{no-hook} (default: @code{()}) (type: list-of-strings) +List of hook script which should not be invoked. + +@item @code{static} (default: @code{()}) (type: list-of-strings) +DHCP client can request different options from a DHCP server, through +@code{static} it is possible to configure static values for selected +options. For example, @code{"domain_name_servers=127.0.0.1"}. + +@item @code{vendor-class-id} (type: maybe-string) +Set the DHCP Vendor Class (e.g., @code{MSFT}). For more information, +refer to @uref{https://www.rfc-editor.org/rfc/rfc2132#section-9.13,RFC +2132}. + +@item @code{client-id} (type: maybe-string) +Use the interface hardware address or the given string as a client +identifier, this is matually exclusive with the @code{duid} option. + +@item @code{extra-content} (type: maybe-string) +Extra content to append to the configuration as-is. + +@end table +@end deftp + + @cindex NetworkManager @defvar network-manager-service-type diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 53840c2764..85ad5287f2 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -109,6 +109,24 @@ (define-module (gnu services networking) dhcpd-configuration-pid-file dhcpd-configuration-interfaces + dhcpcd-service-type + dhcpcd-configuration + dhcpcd-configuration? + dhcpcd-configuration-interfaces + dhcpcd-configuration-command-arguments + dhcpcd-configuration-host-name + dhcpcd-configuration-duid + dhcpcd-configuration-persistent? + dhcpcd-configuration-option + dhcpcd-configuration-require + dhcpcd-configuration-slaac + dhcpcd-configuration-no-option + dhcpcd-configuration-no-hook + dhcpcd-configuration-static + dhcpcd-configuration-vendor-class-id + dhcpcd-configuration-client-id + dhcpcd-configuration-extra-content + ntp-configuration ntp-configuration? ntp-configuration-ntp @@ -492,6 +510,149 @@ (define dhcpd-service-type (description "Run a DHCP (Dynamic Host Configuration Protocol) daemon. The daemon is responsible for allocating IP addresses to its client."))) + +;; +;; DHCPCD. +;; + +(define (serialize-field-name field-name) + (let ((str (symbol->string field-name))) + (string-replace-substring + (if (string-suffix? "?" str) + (string-drop-right str 1) + str) + "-" ""))) + +(define (dhcpcd-serialize-string field-name value) + (if (equal? field-name 'extra-content) + #~(string-append #$value "\n") + #~(format #f "~a ~a~%" #$(serialize-field-name field-name) #$value))) + +(define (dhcpcd-serialize-boolean field-name value) + (if value + #~(format #f "~a~%" #$(serialize-field-name field-name)) + "")) + +(define (dhcpcd-serialize-list-of-strings field-name value) + #~(string-append #$@(map (cut dhcpcd-serialize-string field-name <>) value))) + +;; Some fields (e.g. host-name) can be specified with an empty string argument. +;; Therefore, we need a maybe type to differentiate disabled/empty-string. +(define-maybe string (prefix dhcpcd-)) + +(define-configuration dhcpcd-configuration + (interfaces + (list '()) + "List of networking interfaces---e.g., @code{\"eth0\"}---to start a DHCP client +for. If no interface is specified (i.e., the list is empty) then @command{dhcpcd} +discovers available Ethernet interfaces, that can be configured, automatically." + empty-serializer) + (command-arguments + (list '("-q" "-q")) + "List of additional command-line options." + empty-serializer) + + ;; The following defaults replicate the default dhcpcd configuration file. + ;; + ;; See https://github.com/NetworkConfiguration/dhcpcd/tree/v10.0.10#configuration + (host-name + (maybe-string "") + "Host name to send via DHCP, defaults to the current system host name.") + (duid + (maybe-string "") + "DHCPv4 clients require a unique client identifier, this option uses the DHCPv6 +Unique Identifier as a DHCPv4 client identifier as well. For more information, refer +to @uref{https://www.rfc-editor.org/rfc/rfc4361, RFC 4361} and @code{dhcpcd.conf(5)}.") + (persistent? + (boolean #t) + "When true, automatically de-configure the interface when @command{dhcpcd} exits.") + (option + (list-of-strings + '("rapid_commit" + "domain_name_servers" + "domain_name" + "domain_search" + "host_name" + "classless_static_routes" + "interface_mtu")) + "List of options to request from the server.") + (require + (list-of-strings '("dhcp_server_identifier")) + "List of options to require in responses.") + (slaac + (maybe-string "private") + "Interface identifier used for SLAAC generated IPv6 addresses.") + + ;; Common options not set in the default configuration file. + (no-option + (list-of-strings '()) + "List of options to remove from the message before it's processed.") + (no-hook + (list-of-strings '()) + "List of hook script which should not be invoked.") + (static + (list-of-strings '()) + "DHCP client can request different options from a DHCP server, through +@code{static} it is possible to configure static values for selected options. For +example, @code{\"domain_name_servers=127.0.0.1\"}.") + (vendor-class-id + maybe-string + "Set the DHCP Vendor Class (e.g., @code{MSFT}). For more information, refer +to @uref{https://www.rfc-editor.org/rfc/rfc2132#section-9.13,RFC 2132}.") + (client-id + maybe-string + "Use the interface hardware address or the given string as a client identifier, +this is matually exclusive with the @code{duid} option.") + + ;; Escape hatch for the generated configuration file. + (extra-content + maybe-string + "Extra content to append to the configuration as-is.") + + (prefix dhcpcd-)) + +(define (dhcpcd-config-file config) + (mixed-text-file "dhcpcd.conf" + (serialize-configuration + config + dhcpcd-configuration-fields))) + +(define dhcpcd-account-service + (list (user-group (name "dhcpcd") (system? #t)) + (user-account + (name "dhcpcd") + (group "dhcpcd") + (system? #t) + (comment "dhcpcd daemon user") + (home-directory "/var/empty") + (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 + #~(make-forkexec-constructor + (list (string-append #$dhcpcd "/sbin/dhcpcd") + #$@command-args "-B" "-f" #$config-file #$@ifaces))) + (stop #~(make-kill-destructor)))))) + +(define dhcpcd-service-type + (service-type (name 'dhcpcd) + (description "Run the dhcpcd daemon.") + (extensions + (list (service-extension account-service-type + (const dhcpcd-account-service)) + (service-extension shepherd-root-service-type + dhcpcd-shepherd-service))) + (compose concatenate) + (default-value (dhcpcd-configuration)))) + ;;; ;;; NTP. diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index e7c02b9e00..7d54ebba50 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -32,6 +32,7 @@ (define-module (gnu tests networking) #:use-module (guix store) #:use-module (guix monads) #:use-module (guix modules) + #:use-module (gnu packages admin) #:use-module (gnu packages bash) #:use-module (gnu packages linux) #:use-module (gnu packages networking) @@ -44,6 +45,7 @@ (define-module (gnu tests networking) %test-inetd %test-openvswitch %test-dhcpd + %test-dhcpcd %test-tor %test-iptables %test-ipfs)) @@ -673,6 +675,110 @@ (define %test-dhcpd (description "Test a running DHCP daemon configuration.") (value (run-dhcpd-test)))) + +;;; +;;; DHCPCD Daemon +;;; + +(define %dhcpcd-os + (let ((base-os + (simple-operating-system + (service dhcpcd-service-type + (dhcpcd-configuration + (command-arguments '("--debug" "--logfile" "/dev/console")) + (interfaces '("ens3"))))))) + (operating-system + (inherit base-os) + (packages + (append (list dhcpcd iproute) + (operating-system-packages base-os)))))) + +(define (run-dhcpcd-test) + "Run tests in %dhcpcd-os with a running dhcpcd daemon on localhost." + (define os + (marionette-operating-system + %dhcpcd-os + #:imported-modules '((gnu services herd)))) + + (define vm + (virtual-machine os)) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-64) + (gnu build marionette)) + (define marionette + (make-marionette (list #$vm))) + + (define (wait-for-lease) + (marionette-eval + '(begin + (use-modules (ice-9 popen) (ice-9 rdelim)) + + (let loop ((i 15)) + (if (> i 0) + (let* ((port (open-input-pipe "dhcpcd --dumplease ens3")) + (output (read-string port))) + (close-port port) + (unless (string-contains output "reason=BOUND") + (sleep 1) + (loop (- i 1)))) + (error "failed to obtain a DHCP lease")))) + marionette)) + + (test-runner-current (system-test-runner #$output)) + (test-begin "dhcpcd") + + (test-assert "service is running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + + ;; Make sure the 'dhcpcd' command is found. + (setenv "PATH" "/run/current-system/profile/sbin") + + (wait-for-service 'networking)) + marionette)) + + (test-assert "IPC socket exists" + (marionette-eval + '(file-exists? "/var/run/dhcpcd/ens3.sock") + marionette)) + + (test-equal "IPC is functional" + 0 + (marionette-eval + '(status:exit-val + (system* "dhcpcd" "--dumplease" "ens3")) + marionette)) + + (test-equal "aquires IPv4 address via DHCP" + 1 + (and + (wait-for-lease) + (marionette-eval + '(begin + (use-modules (ice-9 popen) (ice-9 rdelim)) + + (let* ((port (open-input-pipe "ip -4 address show dev ens3")) + (lines (string-split (read-string port) #\newline))) + (close-port port) + (length + (filter (lambda (line) + (string-contains line "scope global dynamic")) + lines)))) + marionette))) + + (test-end)))) + (gexp->derivation "dhcpcd-test" test)) + +(define %test-dhcpcd + (system-test + (name "dhcpcd") + (description "Test that the dhcpcd obtains IP DHCP leases.") + (value (run-dhcpcd-test)))) + ;;; ;;; Services related to Tor base-commit: 9bc4c9f521caab8aa8d88aa948a650945bb55838 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 07 09:36:24 2025 Received: (at 75934) by debbugs.gnu.org; 7 Mar 2025 14:36:24 +0000 Received: from localhost ([127.0.0.1]:47596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tqYoK-00059M-CL for submit@debbugs.gnu.org; Fri, 07 Mar 2025 09:36:24 -0500 Received: from magnesium.8pit.net ([45.76.88.171]:19815) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tqYoH-00059B-7U for 75934@debbugs.gnu.org; Fri, 07 Mar 2025 09:36:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=opensmtpd; bh=5niR1B9L 7gcsTu5IB0lcMPPIwgmSuaMMRKoK9i9xjdI=; h=in-reply-to:references:from: subject:cc:to:date; d=soeren-tempel.net; b=f8hylOKuOaMCrIZ0KACJIv/MLXq KUH09KqbZ2nP1ZFnM9ao2HeKs0WiJ/Jx7iqlECZQQni1zUSkDpNq3JrLcBBpGeFqDOdJrU g5i48ZMvTBh+JmUqyzLl19jlZt2xtwXeoF/x8RDebpiU0zGRzmmvlAFI7yBvHdVcNg7a4G WWDc= Received: from localhost ( [2a02:560:4d83:4d00:581f:35a1:9dc3:d0ba]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id d66a55bb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Fri, 7 Mar 2025 15:36:20 +0100 (CET) Date: Fri, 07 Mar 2025 15:36:19 +0100 To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: Re: [bug#75934] [PATCH] services: networking: Add dhcpcd service. From: =?UTF-8?Q?S=C3=B6ren?= Tempel References: <20250129204935.2331-1-soeren@soeren-tempel.net> <87eczbz5zn.fsf@gnu.org> In-Reply-To: <87eczbz5zn.fsf@gnu.org> Message-Id: <22THNS1BI8DUL.30D2STRT7NS06@8pit.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75934 Cc: Quelln@protonmail.com, 873216071@qq.com, 75934@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ludovic Court=C3=A8s wrote: > Hi, Hi Ludo, Thanks a lot for your feedback! I just send a v2 which hopefully address all of it. Most importantly, I have significantly expanded the documentation, both of the general service (where I have included a more complex example) and the individual record type fields. Moreover, I have hyphened the record field names as requested and suffixed boolean fields with question marks. I have abstained from renaming fields entirely to more easily map them to dhcpcd's configuration man page, to which I have added references where appropriate. > soeren@soeren-tempel.net skribis: > > + (list '("-q" "-q")) >=20 > Twice? Yes, this is required to prevent all console output. See https://man.archlinux.org/man/extra/dhcpcd/dhcpcd.8.en#q Greetings S=C3=B6rens From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 08 10:10:56 2025 Received: (at 75934-done) by debbugs.gnu.org; 8 Mar 2025 15:10:56 +0000 Received: from localhost ([127.0.0.1]:56130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tqvpH-0003Cz-Ny for submit@debbugs.gnu.org; Sat, 08 Mar 2025 10:10:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47912) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tqvpD-0003Ce-HQ for 75934-done@debbugs.gnu.org; Sat, 08 Mar 2025 10:10:52 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tqvp7-0005B1-20; Sat, 08 Mar 2025 10:10:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=ddrWZXdzqQtFznSzJ7XETbsxc38H1gVpLDb2npI03K8=; b=qa9agu5qBXW+vIFNEJhv M7gjyT5rUGUvH7OhTRGqjDy0TLp4OkMJ9ypLJ0PyQfG3w93LZRbZsw1vrY3Bx1Np4iXj1wLYbuRk5 oJjXpLfsDOrt7wR3uYp7QDY+N4CZlgU6Gc8oDZvJGnSUU4+xYWwKlWJDK4ONGx+ljdy7MXt/a16cI BpJ71qcGufARlkyi74wrE6L6k/duNKi4zGQKVR1Gf92k6trj6/3HqkdItGsQXaNOvec2+LEt/XYFl 8EyXtsl+qS1tlsgQe22DSFUgXaDlhfeWSx8tqjZK3j/K+9kQ81Z3bXxdFGYhsHPwTkIMmzB/IP+WA 7lJPo6EI10aATA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: soeren@soeren-tempel.net Subject: Re: [bug#75934] [PATCH v2] services: networking: Add dhcpcd service. In-Reply-To: (soeren@soeren-tempel.net's message of "Fri, 7 Mar 2025 15:29:05 +0100") References: <20250129204935.2331-1-soeren@soeren-tempel.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 18 =?utf-8?Q?Vent=C3=B4se?= an 233 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Mouron X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 08 Mar 2025 16:10:42 +0100 Message-ID: <877c4zv9ql.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75934-done Cc: 75934-done@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello S=C3=B6ren, soeren@soeren-tempel.net skribis: > From: S=C3=B6ren Tempel > > This is intended as an alternative to dhcp-client-service-type as > isc-dhcp has reached its end-of-life in 2022 (three years ago!), > see #68619 for more details. Long-term, this services is therefore > intended to replace dhcp-client-service-type. > > * gnu/services/networking.scm (dhcpcd-service-type): New service. > (dhcpcd-shepherd-service): New procedure. > (dhcpcd-account-service): New variable. > (dhcpcd-config-file): New procedure. > (dhcpcd-configuration): New record type. > (dhcpcd-serialize-list-of-strings, dhcpcd-serialize-boolean) > (dhcpcd-serialize-string): New procedures. > (serialize-field-name): New procedure. > * gnu/tests/networking.scm (run-dhcpcd-test): New procedure. > (%dhcpcd-os, %test-dhcpcd): New variables. > * doc/guix.texi (Networking Services): Document it. > --- > Change since v1: > > * Expand documentation and include a larger configuration example > * Improve record type by hyphening record field names > * Use make-forkexec-constructor in shepherd service > * Fix indention of if expression Great. Applied, thanks! Ludo'. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 08 21:47:05 2025 Received: (at 75934) by debbugs.gnu.org; 9 Mar 2025 02:47:06 +0000 Received: from localhost ([127.0.0.1]:57495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tr6gz-0004pQ-Js for submit@debbugs.gnu.org; Sat, 08 Mar 2025 21:47:05 -0500 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:44232) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tr6gx-0004ot-BC for 75934@debbugs.gnu.org; Sat, 08 Mar 2025 21:47:04 -0500 Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-4750c3b0097so27546581cf.0 for <75934@debbugs.gnu.org>; Sat, 08 Mar 2025 18:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741488417; x=1742093217; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VxvtzbaMM9nwpP9vYret+NvLgBhOvLCzQC/Y/cka8pY=; b=ZYBDKmZs3txEPNMOqB2khjqULQPqVc44bHesWEY9bKj/KM0zY+Tm5Y968QzfEY97c0 YW9uT2UjTIays7uucQZo/MMRwlR3anxfDiQ5XnpFSt6OLUipYQOuDgIn8uPMuo2LmYOB KJ4zDqGP4kZ0lQpxTyQ5VtHmtIAxvGG4aeY8M/bPwupxaRJ2EV6ZBALWh/l0U+W+ENBz /5CYwHVkC4+EvwmLxrjUtx0v4ZHXWuk/QohUyyy0LxzrHPPVpFtPRVo1svCCxi6iUzQw /YvFyMlJ0tcUywJnqMoV5MbF+0+ClJWjaD2atcUMcr+gGxPGzFv8S7qTQokhK2U8DqUY /H5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741488417; x=1742093217; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VxvtzbaMM9nwpP9vYret+NvLgBhOvLCzQC/Y/cka8pY=; b=sq521T6B3QvWtyMWhGuvxL2X8icPJLNNn8gvLQDbdgSGj+uaMp8RH/n2cpSq+AR148 UxceIQ8baLhlum43M+/Bp8cYpgyrQ25Bh+Q3qOjT+6b6291s9Y1t2slD3HX+SMKfhvGT epBPAAxSCxSIPwDzuRj8BIDkota8sgzdOMaubCJBU25iQhib3bxWjNwDqICTfmDusKx2 YbgVRTNMnhG0fwryVC8zewoUx89HWuFgNJ0gvF5anGRPPHUAxdvjT4nBEsdTBGfBPBPY bKiyLi9FhBl3w93dWzvRZGP9MfNkSnIrvfqQ/6KtDBFAUmmo++NKNcH1c5VzFzHv/9er jKHA== X-Gm-Message-State: AOJu0YzZ0VQhHLpYTSs3o/1mNl0hMZiJBdXz4yviU5Avoc57z8DYI7gY ZmDzjPD/gB8+YR4nzHYXDXEDtn4hbZVMKohst9diOfYpD7K33B5w X-Gm-Gg: ASbGnctvlnbhlRY/IFa0UIQ3x4GorDye5zcCPbCCsseXenBEimPenjqQri3XARqtf9U xbrei8Wcf/dMcxNXzCN6nKi5ghrufDpLpKfE1lw29u5QL6vgDU/nrQlRgACr04/M8dkpBxr+NBn VyqeWMtZTnyqBzMT4o9a9ibGYvqzxSacSRDkQJLYkA3WIHGpy/6qrpUde0C2EaMZB7Q/v0UQlh7 UJSiU+O53pcz6uof7dvQy7zcUTW+T9NcGQGJx+VDfhniX+gtz//5spDCKEVatEQ9XG51bTwOZdp p90xgm7waA4q+eUKXVsbCuq3Xyc/lLH9B0QT3q4NTkgqx1PGYyuSI+aJ498XSKsbQw== X-Google-Smtp-Source: AGHT+IGTm93AeNoTZYu20334oExEILzQ87iSooEcAGwI7MVBiy7NbLgZ6m9u69xB1zbVjx/lFECudg== X-Received: by 2002:ac8:594b:0:b0:474:f3af:33ec with SMTP id d75a77b69052e-47611854d35mr129565591cf.38.1741488417479; Sat, 08 Mar 2025 18:46:57 -0800 (PST) Received: from terra (vps-6234970c.vps.ovh.ca. [51.222.13.224]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4767ffd41b3sm1876161cf.54.2025.03.08.18.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 18:46:56 -0800 (PST) From: Maxim Cournoyer To: soeren@soeren-tempel.net Subject: Re: bug#75934: [PATCH] services: networking: Add dhcpcd service. In-Reply-To: <20250129204935.2331-1-soeren@soeren-tempel.net> (soeren@soeren-tempel.net's message of "Wed, 29 Jan 2025 21:45:22 +0100") References: <20250129204935.2331-1-soeren@soeren-tempel.net> Date: Sun, 09 Mar 2025 11:46:41 +0900 Message-ID: <87ikoix6ni.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75934 Cc: Quelln@protonmail.com, ludo@gnu.org, 75934@debbugs.gnu.org, 873216071@qq.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Soeren, soeren@soeren-tempel.net writes: > From: S=C3=B6ren Tempel > > This is intended as an alternative to dhcp-client-service-type as > isc-dhcp has reached its end-of-life in 2022 (three years ago!), > see #68619 for more details. Long-term, this services is therefore > intended to replace dhcp-client-service-type. I was wondering, why can't this replacement happen *today* ? The old dhcp-client-service-type could be marked as deprecated, with dhcpcd-service-type as a replacement. The system templates under gnu/system/examples can then be adjusted to s/dhcp-client-service-type/dhcpcd-service-type/ and the doc of dhcp-client-service-type can say it is deprecated via a warning. Thanks for working on it! --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 09 06:23:47 2025 Received: (at 75934) by debbugs.gnu.org; 9 Mar 2025 10:23:47 +0000 Received: from localhost ([127.0.0.1]:58512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trDox-0001lX-7b for submit@debbugs.gnu.org; Sun, 09 Mar 2025 06:23:47 -0400 Received: from magnesium.8pit.net ([45.76.88.171]:8290) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1trDou-0001lI-6Z for 75934@debbugs.gnu.org; Sun, 09 Mar 2025 06:23:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=opensmtpd; bh=/DPvQ5cO qeRFsQjen8EQkthpmaKUDHojyKE+G+3L7jA=; h=in-reply-to:references:from: subject:cc:to:date; d=soeren-tempel.net; b=b2mVl+LJeOPC76a1RjggUrDVbg7 g3tFzePmjtz/emkCkHXqUZlQVwftA13HuuyffhVzg2hUE2sUkWaq2AdMhObgJJ3fAcGaf8 Na6I6BlSYz0wUpe26iZU3hZEj4aEFpxDWqyof8nYbW3GzN5stwXbvyu80d2XaR+wda7ZOg pa/0= Received: from localhost ( [2a02:560:4d83:4d00:bd03:964d:ccba:ee86]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 3d809724 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Sun, 9 Mar 2025 11:23:42 +0100 (CET) Date: Sun, 09 Mar 2025 11:23:41 +0100 To: Maxim Cournoyer Subject: Re: bug#75934: [PATCH] services: networking: Add dhcpcd service. From: =?UTF-8?Q?S=C3=B6ren?= Tempel References: <20250129204935.2331-1-soeren@soeren-tempel.net> <87ikoix6ni.fsf@gmail.com> In-Reply-To: <87ikoix6ni.fsf@gmail.com> Message-Id: <20TPU24XQAJF8.2U9JN370N7FGS@8pit.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75934 Cc: Quelln@protonmail.com, ludo@gnu.org, 75934@debbugs.gnu.org, 873216071@qq.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Maxim Cournoyer wrote: > Hi Soeren, Hello Maxim! > I was wondering, why can't this replacement happen *today* ? My envisioned timeline was testing the new service a bit first (gathering feedback from users) and then deprecating the old service. However, if you think we should deprecate immediately feel free to send a patch doing that, otherwise I will look into it in the coming weeks. Further, my thinking was that, considering Guix's review capacities, splitting this into smaller chunks (adding the package, adding the service, deprecating the old service, =E2=80=A6) makes this easier to revie= w. Greetings, S=C3=B6ren From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 09 19:58:38 2025 Received: (at 75934) by debbugs.gnu.org; 9 Mar 2025 23:58:38 +0000 Received: from localhost ([127.0.0.1]:35018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trQXW-0008Ql-2a for submit@debbugs.gnu.org; Sun, 09 Mar 2025 19:58:38 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:47459) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1trQXS-0008QU-Vh for 75934@debbugs.gnu.org; Sun, 09 Mar 2025 19:58:35 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-224341bbc1dso32566655ad.3 for <75934@debbugs.gnu.org>; Sun, 09 Mar 2025 16:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741564709; x=1742169509; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4XpIkJfIlCgpOmdfefHAzXl2DZos9zX9eSi+EWHANoI=; b=SM/wswQXc3RuM0lfXRGGRktD4CJHwI7qid2qWxKmG9isGzSqSPzLfi2SMbzdWhAQyI p6OAOce74DsbLYpP/zkAP7nCb9vc7l8e5FBS/z2BDc7aebSgDbg4WTDVJNu3GzvQvUvI wy1UdjPtRMJF3l/SWclpi8v5SybGF/j7ESB5tzYuOJSN1L+3vVt8HKXl8bEcYiSyNZTq hvPNuX9Vrc3HBL7aMgzDmw4qwAfGo/fc5hvyr0AePkq1CkvY4J5KSgE/VvFkDpFAykXV s/sqhhikAAgVwt7mXbRl9aSmQ+CJgG7186dSPYhVfQIT+6kYoWNVmmX0JVz3sPgr1cT/ r+rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741564709; x=1742169509; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4XpIkJfIlCgpOmdfefHAzXl2DZos9zX9eSi+EWHANoI=; b=EBqlJ18vjzaF448ny3SigoFurgsjFLmUe+Oa0edgECZ5NLrjxlNAwZWwnZO3/fI6m3 b54AViIf/xI6QdMu6n1iC2jnXDWvjO3EuTrQhmbxMlq6/1ZaI1SNQUJUmwaoHyA4gBnq uqK1hoAEZlMj7v4J+DFsnVoPzQj+mtDdxIamIALqkDvDKuw729TuHb6K9LTXNm+16daz mZosBY96qbin0ytXUxS4OTeWIZI7REts8nxK1AHi8CiTu/qwVkBvKK6rNXugnd3oJr8y J59t7qi1XRF1VHgyBkMOBQQyP3DmViPDnUp/RxR/5WYxvj6w9PvBdXZ07/VRyO7FFoi1 5x7w== X-Gm-Message-State: AOJu0YwczsNnkc9mOBveRGTFRsh65arGfFGxgeA+lvijviUqzbHCA4pn Q5esNyhB3uJWbjPGWk66XJV0LPKDENMp/B322XzY1FquCObT2I4O X-Gm-Gg: ASbGnctSCxJrTxKkP8iRTvma7b5Z+qHYMYQvMVyz+Ab0boUY3rr5SPXAnC94esbHkbY ZIFNuBO3Tloto6e68s74owdOrx+UC7Z19Qi44YqkUHW33e66W/8AQOs7b8QJeb7EVbzqjKgd3Kq BpQdmQ0rghGckTKwHkpw3a3R/JKqn+rMmz3r4uJSKqWtpHakvKhyNu7Qtr3XJRTNf+daU4VVxGP kx8IxsAO86AT4elz1beSXaPA3E558KfGIeUd0eAzxm6d9dZvji+pSdGxz7pN8eu/SojfPpgWOjO t2KFAIUPMGPtFsJlGFpvBO40Gub4DWV2sc4KjWksxxr4AiFxpH8rjA== X-Google-Smtp-Source: AGHT+IECCul+IYyKsZWDgXqgSUr73sAwtbtV8EhRGE1QiHEIt8kcf1xmSZULOtoM5v9RycypG2kSuQ== X-Received: by 2002:a17:903:19ce:b0:223:58ff:c722 with SMTP id d9443c01a7336-22428a96b0emr226751455ad.28.1741564708884; Sun, 09 Mar 2025 16:58:28 -0700 (PDT) Received: from terra ([2405:6586:be0:0:83c8:d31d:2cec:f542]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22410a8209esm65224755ad.129.2025.03.09.16.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Mar 2025 16:58:28 -0700 (PDT) From: Maxim Cournoyer To: =?utf-8?Q?S=C3=B6ren?= Tempel Subject: Re: bug#75934: [PATCH] services: networking: Add dhcpcd service. In-Reply-To: <20TPU24XQAJF8.2U9JN370N7FGS@8pit.net> (=?utf-8?Q?=22S=C3=B6r?= =?utf-8?Q?en?= Tempel"'s message of "Sun, 09 Mar 2025 11:23:41 +0100") References: <20250129204935.2331-1-soeren@soeren-tempel.net> <87ikoix6ni.fsf@gmail.com> <20TPU24XQAJF8.2U9JN370N7FGS@8pit.net> Date: Mon, 10 Mar 2025 08:58:14 +0900 Message-ID: <87ikohsqnd.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75934 Cc: Quelln@protonmail.com, ludo@gnu.org, 75934@debbugs.gnu.org, 873216071@qq.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi S=C3=B6ren, S=C3=B6ren Tempel writes: > Maxim Cournoyer wrote: >> Hi Soeren, > > Hello Maxim! > >> I was wondering, why can't this replacement happen *today* ? > > My envisioned timeline was testing the new service a bit first > (gathering feedback from users) and then deprecating the old service. > However, if you think we should deprecate immediately feel free to send > a patch doing that, otherwise I will look into it in the coming weeks. > > Further, my thinking was that, considering Guix's review capacities, > splitting this into smaller chunks (adding the package, adding the > service, deprecating the old service, =E2=80=A6) makes this easier to rev= iew. This all makes sense/is reasonable. I'll wait for you to go through this. Thank you for your contributions! --=20 Maxim From unknown Sat Aug 16 16:06:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 07 Apr 2025 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator