--- Begin Message ---
Subject: |
Static networking vs Open vSwitch |
Date: |
Thu, 02 Nov 2017 20:13:05 +0100 |
User-agent: |
Notmuch/0.25.1 (https://notmuchmail.org) Emacs/25.3.1 (x86_64-pc-linux-gnu) |
Hello Guix,
When using static-networking-service with OpenvSwitch-managed
interfaces, shepherd will often attempt to start the static interface
configuration before the virtual interface has been created by OVS,
requiring manual intervention after boot.
This first patch allows arbitrary services to override 'requirement' in
<static-networking>; the second adds some tests for Open vSwitch,
including whether static-networking started successfully on a virtual
interface.
Marius Bakke (2):
services: networking: Add a dependency override mechanism to
<static-networking>.
tests: networking: Add tests for OpenvSwitch.
doc/guix.texi | 5 +-
gnu/services/networking.scm | 14 ++++--
gnu/tests/networking.scm | 109 +++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 121 insertions(+), 7 deletions(-)
--
2.15.0
signature.asc
Description: PGP signature
--- End Message ---
--- Begin Message ---
Subject: |
Re: [PATCH 1/2] services: networking: Add a dependency override mechanism to <static-networking>. |
Date: |
Fri, 29 Dec 2017 14:12:35 +0100 |
User-agent: |
Notmuch/0.25.3 (https://notmuchmail.org) Emacs/25.3.1 (x86_64-pc-linux-gnu) |
Marius Bakke <address@hidden> writes:
> * gnu/services/networking.scm (<static-networking>): Add 'requirement' record.
> (static-networking-shepherd-service): Make UDEV the default requirement.
> (static-networking-service): Expose 'requirement' parameter.
> * doc/guix.texi (Networking Services): Document it.
I finally got around to properly test this patch on Real Systems. There
was a problem with it: even though 'requirement' was added to the the
<static-networking> record with a default value, #:requirement became a
mandatory parameter when using (static-networking-service).
This fixup commit solves it:
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index dbfe15a31..c3ba0787c 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -147,9 +147,8 @@ fe80::1%lo0 apps.facebook.com\n")
(default #f))
(provision static-networking-provision
(default #f))
- ;; Wait for udev to be up so that interfaces are actually usable.
(requirement static-networking-requirement
- (default '(udev)))
+ (default '()))
(name-servers static-networking-name-servers ;FIXME: doesn't belong here
(default '())))
@@ -160,11 +159,9 @@ fe80::1%lo0 apps.facebook.com\n")
(let ((loopback? (and provision (memq 'loopback provision))))
(shepherd-service
- ;; Force the loopback interface to start early.
- (requirement (if loopback? '() requirement))
-
(documentation
"Bring up the networking interface using a static IP address.")
+ (requirement requirement)
(provision (or provision
(list (symbol-append 'networking-
(string->symbol interface)))))
@@ -266,7 +263,9 @@ network interface.")))
(define* (static-networking-service interface ip
#:key
- netmask gateway provision requirement
+ netmask gateway provision
+ ;; Most interfaces require udev to be
usable.
+ (requirement '(udev))
(name-servers '()))
"Return a service that starts @var{interface} with address @var{ip}. If
@var{netmask} is true, use it as the network mask. If @var{gateway} is true,
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 7fc8f6aa7..f4681c804 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1986,6 +1986,7 @@ This service is not part of @var{%base-services}."
(service static-networking-service-type
(list (static-networking (interface "lo")
(ip "127.0.0.1")
+ (requirement '())
(provision '(loopback)))))
(syslog-service)
(service urandom-seed-service-type)
<static-networking>[requirement] now defaults to the empty list, but
(static-network-service ...) adds udev if nothing is specified.
Since there were no complaints about the original patch, I assume the
intent was okay and went ahead and pushed this.
signature.asc
Description: PGP signature
--- End Message ---