[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29117: [PATCH 1/2] services: networking: Add a dependency override m

From: Marius Bakke
Subject: bug#29117: [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 ( 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\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\n")
      (let ((loopback? (and provision (memq 'loopback provision))))
-        ;; Force the loopback interface to start early.
-        (requirement (if loopback? '() requirement))
          "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
-                                    netmask gateway provision requirement
+                                    netmask gateway provision
+                                    ;; Most interfaces require udev to be 
+                                    (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 "")
+                                          (requirement '())
                                           (provision '(loopback)))))
         (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.

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]