[PATCH 0/1] Provide a way to use multiple dhcp clients with static-networking

  • Done
  • quality assurance status badge
Details
2 participants
  • Alexey Abramov
  • Ludovic Courtès
Owner
unassigned
Submitted by
Alexey Abramov
Severity
normal
A
A
Alexey Abramov wrote on 25 Jul 2023 12:57
(address . guix-patches@gnu.org)
20230725105739.17244-1-levenson@mmer.org
In a case you need to configure existing interfaces, rename them or for
example construct a bond first and attach dhcp client to it, we need to run
static-networking AND dhcp-client at the same time. At this moment both
services provision 'networking by default.

Even though we can override provision for static-networking, it is still not
enough in case we need to run multiple dhcp-clients on different interfaces.

This patch will allow provision override for dhcp-client. This is an addition to bug#64616.

Alexey Abramov (1):
services: dhcp-client-configuration: Allow provision override

gnu/services/networking.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

--
2.40.1
A
A
Alexey Abramov wrote on 25 Jul 2023 12:59
[PATCH 1/1] services: dhcp-client-configuration: Allow provision override
(address . 64850@debbugs.gnu.org)
20230725105956.17963-1-levenson@mmer.org
* gnu/services/networking.scm: Allow setting up provision to allow running
DHCP client and static network configuration simultaneously.
---
gnu/services/networking.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Toggle diff (40 lines)
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 5657b141d9..dc75c2f59d 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -88,6 +88,7 @@ (define-module (gnu services networking)
dhcp-client-configuration
dhcp-client-configuration?
dhcp-client-configuration-package
+ dhcp-client-configuration-provision
dhcp-client-configuration-interfaces
dhcp-client-configuration-shepherd-requirement
@@ -303,6 +304,8 @@ (define-record-type* <dhcp-client-configuration>
(default isc-dhcp))
(shepherd-requirement dhcp-client-configuration-shepherd-requirement
(default '()))
+ (provision dhcp-client-configuration-provision
+ (default '(networking)))
(interfaces dhcp-client-configuration-interfaces
(default 'all))) ;'all | list of strings
@@ -312,6 +315,7 @@ (define dhcp-client-shepherd-service
(let ((package (dhcp-client-configuration-package config))
(shepherd-requirement (dhcp-client-configuration-shepherd-requirement config))
(interfaces (dhcp-client-configuration-interfaces config))
+ (provision (dhcp-client-configuration-provision config))
(pid-file "/var/run/dhclient.pid"))
(list (shepherd-service
(documentation "Set up networking via DHCP.")
@@ -321,7 +325,7 @@ (define dhcp-client-shepherd-service
;; networking is unavailable, but also means that the interface is not up
;; yet when 'start' completes. To wait for the interface to be ready, one
;; should instead monitor udev events.
- (provision '(networking))
+ (provision provision)
(start #~(lambda _
(define dhclient
--
2.40.1
L
L
Ludovic Courtès wrote on 17 Sep 2023 15:06
Re: bug#64850: [PATCH 0/1] Provide a way to use multiple dhcp clients with static-networking
(name . Alexey Abramov)(address . levenson@mmer.org)(address . 64850-done@debbugs.gnu.org)
87zg1lx82u.fsf_-_@gnu.org
Hi,

Alexey Abramov <levenson@mmer.org> skribis:

Toggle quote (25 lines)
> * gnu/services/networking.scm: Allow setting up provision to allow running
> DHCP client and static network configuration simultaneously.
> ---
> gnu/services/networking.scm | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
> index 5657b141d9..dc75c2f59d 100644
> --- a/gnu/services/networking.scm
> +++ b/gnu/services/networking.scm
> @@ -88,6 +88,7 @@ (define-module (gnu services networking)
> dhcp-client-configuration
> dhcp-client-configuration?
> dhcp-client-configuration-package
> + dhcp-client-configuration-provision
> dhcp-client-configuration-interfaces
> dhcp-client-configuration-shepherd-requirement
>
> @@ -303,6 +304,8 @@ (define-record-type* <dhcp-client-configuration>
> (default isc-dhcp))
> (shepherd-requirement dhcp-client-configuration-shepherd-requirement
> (default '()))
> + (provision dhcp-client-configuration-provision
> + (default '(networking)))

I changed the field name to ‘shepherd-provision’ for consistency and
documented it in ‘doc/guix.texi’. Committed!

Thanks,
Ludo’.
Closed
?