From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 16:13:14 2023 Received: (at submit) by debbugs.gnu.org; 17 Feb 2023 21:13:14 +0000 Received: from localhost ([127.0.0.1]:41700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT82c-0008RF-EJ for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:13:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:57418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT82a-0008R6-9T for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:13:12 -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 1pT82Z-0003CI-UU for guix-patches@gnu.org; Fri, 17 Feb 2023 16:13:11 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pT82Y-0003li-5H for guix-patches@gnu.org; Fri, 17 Feb 2023 16:13:11 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 6791E2090F for ; Fri, 17 Feb 2023 22:13:07 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id F00088009A; Fri, 17 Feb 2023 22:13:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id GSn9psJfF-iD; Fri, 17 Feb 2023 22:13:05 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id CB31880098; Fri, 17 Feb 2023 22:13:04 +0100 (CET) From: Bruno Victal To: guix-patches@gnu.org Subject: [PATCH 0/8] networking services refactoring Date: Fri, 17 Feb 2023 21:12:53 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 tags: patch Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.107.240; envelope-from=mirai@makinata.eu; helo=smtpmciv4.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Bruno Victal 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: -2.3 (--) Changes of interest: * Make wpa_supplicant (or iwd) optional. * Fixes networking for NetworkManager starting too early (see [1] e [2]) * Introduces canonical and virtual names for connman and NetworkManager services. [1]: https://issues.guix.gnu.org/60300 [2]: https://issues.guix.gnu.org/47253 Bruno Victal (8): services: network-manager: Add 'shepherd-requirement' field. services: network-manager: Deprecate 'iwd?' field. services: connman: Use match-record and export accessors. services: connman: Add 'shepherd-requirement' field. services: connman: Deprecate 'iwd?' field. services: network-manager: Await for NetworkManager to finish starting up. services: network-manager: Set service canonical-name to NetworkManager. services: connman: Set service canonical-name to connman. doc/guix.texi | 18 +++-- gnu/services/networking.scm | 132 ++++++++++++++++++++++++------------ 2 files changed, 99 insertions(+), 51 deletions(-) base-commit: 8d8e1438ae5a2e50005b500dacd0a26be540fe69 -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 16:15:04 2023 Received: (at 61587) by debbugs.gnu.org; 17 Feb 2023 21:15:04 +0000 Received: from localhost ([127.0.0.1]:41705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT84N-0008Uo-R4 for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:04 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:36788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT84L-0008Tw-ON for 61587@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:02 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id E66F52090F for <61587@debbugs.gnu.org>; Fri, 17 Feb 2023 22:15:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 905B18009A; Fri, 17 Feb 2023 22:15:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aPuIexZBHohC; Fri, 17 Feb 2023 22:15:00 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 1E08880098; Fri, 17 Feb 2023 22:15:00 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH 1/8] services: network-manager: Add 'shepherd-requirement' field. Date: Fri, 17 Feb 2023 21:14:52 +0000 Message-Id: <52d67f14ce662f215c384b59dfe28f446b9b384a.1676667941.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) Note: This also makes wpa-supplicant an optional requirement. * gnu/services/networking.scm () [shepherd-requirement]: New field. (network-manager-shepherd-service): Honor it. (network-manager-configuration-shepherd-requirement): Export accessor. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 6 ++++++ gnu/services/networking.scm | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 44e2165a82..46e0f637d0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19704,6 +19704,12 @@ Networking Setup @item @code{network-manager} (default: @code{network-manager}) The NetworkManager package to use. +@item @code{shepherd-requirement} (default: @code{()}) +This option can be used to provide a list of symbols naming Shepherd services +that this service will depend on, such as @code{'wpa-supplicant} or +@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet +networks. + @item @code{dns} (default: @code{"default"}) Processing mode for DNS, which affects how NetworkManager uses the @code{resolv.conf} configuration file. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index dacf64c2d1..5284855b83 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -143,6 +143,7 @@ (define-module (gnu services networking) network-manager-configuration network-manager-configuration? + network-manager-configuration-shepherd-requirement network-manager-configuration-dns network-manager-configuration-vpn-plugins network-manager-service-type @@ -1140,6 +1141,8 @@ (define-record-type* network-manager-configuration? (network-manager network-manager-configuration-network-manager (default network-manager)) + (shepherd-requirement network-manager-configuration-shepherd-requirement + (default '())) (dns network-manager-configuration-dns (default "default")) (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like @@ -1200,7 +1203,7 @@ (define (network-manager-environment config) (define (network-manager-shepherd-service config) (match-record config - (network-manager dns vpn-plugins iwd?) + (network-manager shepherd-requirement dns vpn-plugins iwd?) (let ((conf (plain-file "NetworkManager.conf" (string-append "[main]\ndns=" dns "\n" @@ -1209,8 +1212,9 @@ (define (network-manager-shepherd-service config) (list (shepherd-service (documentation "Run the NetworkManager.") (provision '(networking)) - (requirement (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '(wpa-supplicant)))) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$network-manager "/sbin/NetworkManager") -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 16:15:16 2023 Received: (at 61587) by debbugs.gnu.org; 17 Feb 2023 21:15:16 +0000 Received: from localhost ([127.0.0.1]:41708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT84a-0008VI-7c for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:16 -0500 Received: from smtpm6.myservices.hosting ([185.26.105.207]:57672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT84Y-0008V8-EK for 61587@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:14 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm6.myservices.hosting (Postfix) with ESMTP id 9AF5520D17 for <61587@debbugs.gnu.org>; Fri, 17 Feb 2023 22:15:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 491548009A; Fri, 17 Feb 2023 22:15:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SRHaobdbZSj2; Fri, 17 Feb 2023 22:15:13 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id C819380098; Fri, 17 Feb 2023 22:15:12 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH 2/8] services: network-manager: Deprecate 'iwd?' field. Date: Fri, 17 Feb 2023 21:14:53 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm (warn-iwd?-field-deprecation): New procedure, helper for deprecated field. ()[iwd?]: Use helper to warn deprecated field. (network-manager-shepherd-service): Make iwd? a local variable independent from the deprecated field. * doc/guix.texi (Networking Setup): Remove mention of iwd? field. --- doc/guix.texi | 4 ---- gnu/services/networking.scm | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 46e0f637d0..8ccd727e6e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19758,10 +19758,6 @@ Networking Setup (VPNs). An example of this is the @code{network-manager-openvpn} package, which allows NetworkManager to manage VPNs @i{via} OpenVPN. -@item @code{iwd?} (default: @code{#f}) -NetworkManager will use iwd as a backend for wireless networking if this -option is set to @code{#t}, otherwise it will use wpa-supplicant. - @end table @end deftp diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 5284855b83..ddf2e20791 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1136,6 +1136,15 @@ (define-record-type* ;;; NetworkManager ;;; +;; TODO: deprecated field, remove later. +(define-with-syntax-properties (warn-iwd?-field-deprecation + (value properties)) + (when value + (warning (source-properties->location properties) + (G_ "the 'iwd?' field is deprecated, please use \ +'shepherd-requirement' field instead~%"))) + value) + (define-record-type* network-manager-configuration make-network-manager-configuration network-manager-configuration? @@ -1147,7 +1156,9 @@ (define-record-type* (default "default")) (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like (default '())) - (iwd? network-manager-configuration-iwd? (default #f))) + (iwd? network-manager-configuration-iwd? ; TODO: deprecated field, remove. + (default #f) + (sanitize warn-iwd?-field-deprecation))) (define (network-manager-activation config) ;; Activation gexp for NetworkManager @@ -1204,7 +1215,10 @@ (define (network-manager-environment config) (define (network-manager-shepherd-service config) (match-record config (network-manager shepherd-requirement dns vpn-plugins iwd?) - (let ((conf (plain-file "NetworkManager.conf" + (let ((iwd? (or iwd? ; TODO: deprecated field, remove later. + (and shepherd-requirement + (memq 'iwd shepherd-requirement)))) + (conf (plain-file "NetworkManager.conf" (string-append "[main]\ndns=" dns "\n" (if iwd? "[device]\nwifi.backend=iwd\n" "")))) @@ -1214,6 +1228,8 @@ (define (network-manager-shepherd-service config) (provision '(networking)) (requirement `(user-processes dbus-system loopback ,@shepherd-requirement + ;; TODO: iwd? is deprecated and should be passed + ;; with shepherd-requirement, remove later. ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$network-manager -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 16:15:28 2023 Received: (at 61587) by debbugs.gnu.org; 17 Feb 2023 21:15:28 +0000 Received: from localhost ([127.0.0.1]:41711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT84l-0008Vi-KY for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:27 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:36862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT84j-0008Va-Na for 61587@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:26 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 4374D2090F for <61587@debbugs.gnu.org>; Fri, 17 Feb 2023 22:15:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id E1FC78009A; Fri, 17 Feb 2023 22:15:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YRy2R1fH6DwZ; Fri, 17 Feb 2023 22:15:24 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 756A980098; Fri, 17 Feb 2023 22:15:24 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH 3/8] services: connman: Use match-record and export accessors. Date: Fri, 17 Feb 2023 21:14:54 +0000 Message-Id: <6e0343b6f71b6fda9ef58c0b1f21fc83a472df44.1676667941.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm (connman-shepherd-service): Use match-record. (connman-configuration-connman, connman-configuration-disable-vpn?) (connman-configuration-iwd?): Export accessors. --- gnu/services/networking.scm | 52 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index ddf2e20791..5cba3a9a3f 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -150,6 +150,9 @@ (define-module (gnu services networking) connman-configuration connman-configuration? + connman-configuration-connman + connman-configuration-disable-vpn? + connman-configuration-iwd? connman-service-type modem-manager-configuration @@ -1300,33 +1303,28 @@ (define (connman-activation config) (mkdir-p "/var/lib/connman-vpn/")))))) (define (connman-shepherd-service config) - "Return a shepherd service for Connman" - (and - (connman-configuration? config) - (let ((connman (connman-configuration-connman config)) - (disable-vpn? (connman-configuration-disable-vpn? config)) - (iwd? (connman-configuration-iwd? config))) - (list (shepherd-service - (documentation "Run Connman") - (provision '(networking)) - (requirement - (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$connman - "/sbin/connmand") - "--nodaemon" - "--nodnsproxy" - #$@(if disable-vpn? '("--noplugin=vpn") '()) - #$@(if iwd? '("--wifi=iwd_agent") '())) - - ;; As connman(8) notes, when passing '-n', connman - ;; "directs log output to the controlling terminal in - ;; addition to syslog." Redirect stdout and stderr - ;; to avoid spamming the console (XXX: for some reason - ;; redirecting to /dev/null doesn't work.) - #:log-file "/var/log/connman.log")) - (stop #~(make-kill-destructor))))))) + (match-record config (connman disable-vpn? iwd?) + (list (shepherd-service + (documentation "Run Connman") + (provision '(networking)) + (requirement + (append '(user-processes dbus-system loopback) + (if iwd? '(iwd) '()))) + (start #~(make-forkexec-constructor + (list (string-append #$connman + "/sbin/connmand") + "--nodaemon" + "--nodnsproxy" + #$@(if disable-vpn? '("--noplugin=vpn") '()) + #$@(if iwd? '("--wifi=iwd_agent") '())) + + ;; As connman(8) notes, when passing '-n', connman + ;; "directs log output to the controlling terminal in + ;; addition to syslog." Redirect stdout and stderr + ;; to avoid spamming the console (XXX: for some reason + ;; redirecting to /dev/null doesn't work.) + #:log-file "/var/log/connman.log")) + (stop #~(make-kill-destructor)))))) (define %connman-log-rotation (list (log-rotation -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 16:15:47 2023 Received: (at 61587) by debbugs.gnu.org; 17 Feb 2023 21:15:47 +0000 Received: from localhost ([127.0.0.1]:41714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT855-0008WG-0V for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:47 -0500 Received: from smtpm5.myservices.hosting ([185.26.105.236]:60902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT853-0008W8-7W for 61587@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:45 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm5.myservices.hosting (Postfix) with ESMTP id 7FCCD20CFC for <61587@debbugs.gnu.org>; Fri, 17 Feb 2023 22:15:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 24FD78009A; Fri, 17 Feb 2023 22:15:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id AL6CHBV8QwRw; Fri, 17 Feb 2023 22:15:43 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id B4E9D80098; Fri, 17 Feb 2023 22:15:43 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH 4/8] services: connman: Add 'shepherd-requirement' field. Date: Fri, 17 Feb 2023 21:14:55 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm () [shepherd-requirement]: New field. (connman-shepherd-service): Honor it. (connman-configuration-shepherd-requirement): Export accessor. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 6 ++++++ gnu/services/networking.scm | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 8ccd727e6e..0a0080b117 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19785,6 +19785,12 @@ Networking Setup @item @code{connman} (default: @var{connman}) The connman package to use. +@item @code{shepherd-requirement} (default: @code{()}) +This option can be used to provide a list of symbols naming Shepherd services +that this service will depend on, such as @code{'wpa-supplicant} or +@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet +networks. + @item @code{disable-vpn?} (default: @code{#f}) When true, disable connman's vpn plugin. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 5cba3a9a3f..30a4d6a6d8 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -151,6 +151,7 @@ (define-module (gnu services networking) connman-configuration connman-configuration? connman-configuration-connman + connman-configuration-shepherd-requirement connman-configuration-disable-vpn? connman-configuration-iwd? connman-service-type @@ -1288,6 +1289,8 @@ (define-record-type* connman-configuration? (connman connman-configuration-connman (default connman)) + (shepherd-requirement connman-configuration-shepherd-requirement + (default '())) (disable-vpn? connman-configuration-disable-vpn? (default #f)) (iwd? connman-configuration-iwd? @@ -1303,13 +1306,14 @@ (define (connman-activation config) (mkdir-p "/var/lib/connman-vpn/")))))) (define (connman-shepherd-service config) - (match-record config (connman disable-vpn? iwd?) + (match-record config (connman shepherd-requirement + disable-vpn? iwd?) (list (shepherd-service (documentation "Run Connman") (provision '(networking)) - (requirement - (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '()))) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$connman "/sbin/connmand") -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 16:16:11 2023 Received: (at 61587) by debbugs.gnu.org; 17 Feb 2023 21:16:11 +0000 Received: from localhost ([127.0.0.1]:41721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT85T-00006A-BK for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:16:11 -0500 Received: from smtpm3.myservices.hosting ([185.26.105.234]:42848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT85S-000062-CS for 61587@debbugs.gnu.org; Fri, 17 Feb 2023 16:16:10 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm3.myservices.hosting (Postfix) with ESMTP id AA79B20FAB for <61587@debbugs.gnu.org>; Fri, 17 Feb 2023 22:16:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 515C48009D; Fri, 17 Feb 2023 22:16:09 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id xqnNzofvaOGM; Fri, 17 Feb 2023 22:16:09 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id E04398009B; Fri, 17 Feb 2023 22:16:08 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH 6/8] services: network-manager: Await for NetworkManager to finish starting up. Date: Fri, 17 Feb 2023 21:14:57 +0000 Message-Id: <502d6efbde6d7e372ab6bc414fbbe2c065c23b4e.1676667941.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) This is similar to its NetworkManager-wait-online.service systemd counterpart, with the main difference being that we handle it all in 'networking symbol, rather than introduce a new 'networking-online symbol. (see discussion #47253) As a result of this change, with opensmtpd-service-type as an example, manual 'herd restart smtpd' after system bootups are no longer required when opensmtpd is configured with a smtpd.conf containing non-loopback interfaces. (this issue is described in more detail at #60300) Addresses #60300. Supersedes #47253. (Note: Shepherd no longer blocks since shepherd 0.9.3) * gnu/services/networking.scm (network-manager-shepherd-service): Await for NetworkManager to finish starting up. --- gnu/services/networking.scm | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 13816327b0..55bc2cf362 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1235,17 +1235,31 @@ (define (network-manager-shepherd-service config) ;; TODO: iwd? is deprecated and should be passed ;; with shepherd-requirement, remove later. ,@(if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$network-manager - "/sbin/NetworkManager") - (string-append "--config=" #$conf) - "--no-daemon") - #:environment-variables - (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn - "/lib/NetworkManager/VPN") - ;; Override non-existent default users - "NM_OPENVPN_USER=" - "NM_OPENVPN_GROUP="))) + (start + #~(lambda args + (let ((constructor + (apply + (make-forkexec-constructor + (list #$(file-append network-manager + "/sbin/NetworkManager") + (string-append "--config=" #$conf) + "--no-daemon") + #:environment-variables + (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn + "/lib/NetworkManager/VPN") + ;; Override non-existent default users + "NM_OPENVPN_USER=" + "NM_OPENVPN_GROUP=")) args))) + ;; XXX: Despite the "online" name, this doesn't guarantee + ;; WAN connectivity, it merely waits for NetworkManager + ;; to finish starting-up. This is required otherwise + ;; services will fail since the network interfaces be + ;; absent until NetworkManager finishes setting them up. + (system* #$(file-append network-manager "/bin/nm-online") + "--wait-for-startup" "--quiet") + ;; XXX: Finally, return the value from running + ;; make-forkexec-constructor to shepherd. + constructor))) (stop #~(make-kill-destructor))))))) (define network-manager-service-type -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 16:16:31 2023 Received: (at 61587) by debbugs.gnu.org; 17 Feb 2023 21:16:31 +0000 Received: from localhost ([127.0.0.1]:41724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT85m-00006k-Nl for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:16:31 -0500 Received: from smtpm8.myservices.hosting ([185.26.105.209]:45118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT85k-00006Z-H5 for 61587@debbugs.gnu.org; Fri, 17 Feb 2023 16:16:29 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm8.myservices.hosting (Postfix) with ESMTP id E288120CBE for <61587@debbugs.gnu.org>; Fri, 17 Feb 2023 22:16:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 91E548009C; Fri, 17 Feb 2023 22:16:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id O3JCv0gLlczV; Fri, 17 Feb 2023 22:16:27 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 2A5068009B; Fri, 17 Feb 2023 22:16:27 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH 7/8] services: network-manager: Set service canonical-name to NetworkManager. Date: Fri, 17 Feb 2023 21:14:58 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) According to the semantics in [1], 'networking should be a "virtual service" and NetworkManager its canonical-name. This does not influence existing services and they should continue to use the 'networking symbol. One visible change is that 'herd status' doesn't show 'networking' anymore, instead listing 'NetworkManager' in its place but both symbols are can be used to start and stop the same service. Note: Though the symbol NetworkManager doesn't really conform with the overall kebab-case used throughout Guix, this is intentional as we really want to make it clear that that the symbol NetworkManager really refers to the software called NetworkManager, since it's a canonical name here. (rather than risk misleading the user to interpret the symbol network-manager as a symbol for some unspecific network management software) [1]: https://www.gnu.org/software/shepherd/manual/html_node/Jump-Start.html * gnu/services/networking.scm (network-manager-shepherd-service): Make 'networking a virtual service and set 'NetworkManager as its canonical name. --- gnu/services/networking.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 55bc2cf362..bcde0d0db8 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1229,7 +1229,7 @@ (define (network-manager-shepherd-service config) (vpn (vpn-plugin-directory vpn-plugins))) (list (shepherd-service (documentation "Run the NetworkManager.") - (provision '(networking)) + (provision '(NetworkManager networking)) (requirement `(user-processes dbus-system loopback ,@shepherd-requirement ;; TODO: iwd? is deprecated and should be passed -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 16:16:41 2023 Received: (at 61587) by debbugs.gnu.org; 17 Feb 2023 21:16:41 +0000 Received: from localhost ([127.0.0.1]:41727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT85x-00007C-2I for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:16:41 -0500 Received: from smtpmciv8.myservices.hosting ([185.26.106.203]:57954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT85v-000071-IK for 61587@debbugs.gnu.org; Fri, 17 Feb 2023 16:16:39 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv8.myservices.hosting (Postfix) with ESMTP id D33C020DD0 for <61587@debbugs.gnu.org>; Fri, 17 Feb 2023 22:16:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 8FAD08009C; Fri, 17 Feb 2023 22:16:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id t7hx1mqAhlwH; Fri, 17 Feb 2023 22:16:38 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 2FFBF8009B; Fri, 17 Feb 2023 22:16:38 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH 8/8] services: connman: Set service canonical-name to connman. Date: Fri, 17 Feb 2023 21:14:59 +0000 Message-Id: <7d438c9abe0b345b718b12a9fec0500fd5c56830.1676667941.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm (connman-shepherd-service): Make 'networking a virtual service and set 'connman as its canonical name. --- gnu/services/networking.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index bcde0d0db8..7c35ff72eb 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1328,7 +1328,7 @@ (define (connman-shepherd-service config) (memq 'iwd shepherd-requirement))))) (list (shepherd-service (documentation "Run Connman") - (provision '(networking)) + (provision '(connman networking)) (requirement `(user-processes dbus-system loopback ,@shepherd-requirement ;; TODO: iwd? is deprecated and should be passed -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 16:24:30 2023 Received: (at 61587) by debbugs.gnu.org; 17 Feb 2023 21:24:30 +0000 Received: from localhost ([127.0.0.1]:41738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT8DW-0000Jo-9k for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:24:30 -0500 Received: from smtpmciv7.myservices.hosting ([185.26.106.202]:50534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT8DU-0000Jg-DP for 61587@debbugs.gnu.org; Fri, 17 Feb 2023 16:24:28 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv7.myservices.hosting (Postfix) with ESMTP id B178920D82 for <61587@debbugs.gnu.org>; Fri, 17 Feb 2023 22:24:26 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id B246B8009A; Fri, 17 Feb 2023 22:15:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8wkCui65d21P; Fri, 17 Feb 2023 22:15:57 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 48A1680098; Fri, 17 Feb 2023 22:15:57 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH 5/8] services: connman: Deprecate 'iwd?' field. Date: Fri, 17 Feb 2023 21:14:56 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm () [iwd?]: Use helper to warn deprecated field. (connman-shepherd-service): Make iwd? a local variable independent from the deprecated field. * doc/guix.texi (Networking Setup): Remove mention of iwd? field. --- doc/guix.texi | 2 -- gnu/services/networking.scm | 50 +++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0a0080b117..67c518ca7d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19794,8 +19794,6 @@ Networking Setup @item @code{disable-vpn?} (default: @code{#f}) When true, disable connman's vpn plugin. -@item @code{iwd?} (default: @code{#f}) -When true, ConnMan uses iwd to connect to wireless networks. @end table @end deftp diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 30a4d6a6d8..13816327b0 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1294,7 +1294,8 @@ (define-record-type* (disable-vpn? connman-configuration-disable-vpn? (default #f)) (iwd? connman-configuration-iwd? - (default #f))) + (default #f) + (sanitize warn-iwd?-field-deprecation))) (define (connman-activation config) (let ((disable-vpn? (connman-configuration-disable-vpn? config))) @@ -1308,27 +1309,32 @@ (define (connman-activation config) (define (connman-shepherd-service config) (match-record config (connman shepherd-requirement disable-vpn? iwd?) - (list (shepherd-service - (documentation "Run Connman") - (provision '(networking)) - (requirement `(user-processes dbus-system loopback - ,@shepherd-requirement - ,@(if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$connman - "/sbin/connmand") - "--nodaemon" - "--nodnsproxy" - #$@(if disable-vpn? '("--noplugin=vpn") '()) - #$@(if iwd? '("--wifi=iwd_agent") '())) - - ;; As connman(8) notes, when passing '-n', connman - ;; "directs log output to the controlling terminal in - ;; addition to syslog." Redirect stdout and stderr - ;; to avoid spamming the console (XXX: for some reason - ;; redirecting to /dev/null doesn't work.) - #:log-file "/var/log/connman.log")) - (stop #~(make-kill-destructor)))))) + (let ((iwd? (or iwd? ; TODO: deprecated field, remove later. + (and shepherd-requirement + (memq 'iwd shepherd-requirement))))) + (list (shepherd-service + (documentation "Run Connman") + (provision '(networking)) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ;; TODO: iwd? is deprecated and should be passed + ;; with shepherd-requirement, remove later. + ,@(if iwd? '(iwd) '()))) + (start #~(make-forkexec-constructor + (list (string-append #$connman + "/sbin/connmand") + "--nodaemon" + "--nodnsproxy" + #$@(if disable-vpn? '("--noplugin=vpn") '()) + #$@(if iwd? '("--wifi=iwd_agent") '())) + + ;; As connman(8) notes, when passing '-n', connman + ;; "directs log output to the controlling terminal in + ;; addition to syslog." Redirect stdout and stderr + ;; to avoid spamming the console (XXX: for some reason + ;; redirecting to /dev/null doesn't work.) + #:log-file "/var/log/connman.log")) + (stop #~(make-kill-destructor))))))) (define %connman-log-rotation (list (log-rotation -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 12:13:50 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 17:13:51 +0000 Received: from localhost ([127.0.0.1]:33861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY8yc-0006Me-Lb for submit@debbugs.gnu.org; Fri, 03 Mar 2023 12:13:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY8yb-0006MS-Ac for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 12:13:49 -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 1pY8yW-0001rq-4g; Fri, 03 Mar 2023 12:13:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=L1VzNs3ZYC54qNmYzmVCLRs4KsLJUTwK24Xdc99Fa5I=; b=meHPfOr83omn63WBqr+X zA14RiKXRzhWrtpWEnZiUDZ0t6cc+OSRfbn7K/SZm9umscMW+uRZ+8JjY+CKET7QxQq8bf+TWRiZq kwpQit5rqhjMA14d85x+0ScxA4wqdAb3KrkXZZcQRn45IkyYu73lO2kpi9tuM1kSsISjTRhfWwaPP bpcd1k3YtrY7W7pnNxswB4icofdKFxRjvOTn0CJLFa5NY+Sjb/voDAjgoSmqqkPHGV7VyuZHOBj9p XyQ4k9JG6DXHf4+5mQTkqKEK08MS5DaNFbc9Ji49SEpZzVImjTEwz2gZhDVtZygT3foTZoDde1nfs We2hipKFF49oFQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pY8yV-0006rs-06; Fri, 03 Mar 2023 12:13:43 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal Subject: Re: bug#61587: [PATCH 0/8] networking services refactoring References: <502d6efbde6d7e372ab6bc414fbbe2c065c23b4e.1676667941.git.mirai@makinata.eu> Date: Fri, 03 Mar 2023 18:13:41 +0100 In-Reply-To: <502d6efbde6d7e372ab6bc414fbbe2c065c23b4e.1676667941.git.mirai@makinata.eu> (Bruno Victal's message of "Fri, 17 Feb 2023 21:14:57 +0000") Message-ID: <87sfelu5a2.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: 61587 Cc: 61587@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: -3.3 (---) Hi, Bruno Victal skribis: > This is similar to its NetworkManager-wait-online.service systemd counter= part, > with the main difference being that we handle it all in 'networking symbo= l, rather than > introduce a new 'networking-online symbol. (see discussion #47253) > > As a result of this change, with opensmtpd-service-type as an example, > manual 'herd restart smtpd' after system bootups are no longer required > when opensmtpd is configured with a smtpd.conf containing non-loopback in= terfaces. > (this issue is described in more detail at #60300) > > Addresses #60300. Please write: =E2=80=9CFixes .=E2=80=9D Possibly along with a =E2=80=9CReported by=E2=80=9D line (see the Git log f= or inspiration). > Supersedes #47253. (Note: Shepherd no longer blocks since shepherd 0.9.3) What does that mean? > * gnu/services/networking.scm (network-manager-shepherd-service): Await f= or > NetworkManager to finish starting up. [...] > + (start > + #~(lambda args > + (let ((constructor > + (apply > + (make-forkexec-constructor > + (list #$(file-append network-manager > + "/sbin/NetworkManager") > + (string-append "--config=3D" #$conf) > + "--no-daemon") Rather: (let ((pid (fork+exec-command (list =E2=80=A6)))) =E2=80=A6 pid) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 12:15:44 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 17:15:44 +0000 Received: from localhost ([127.0.0.1]:33866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY90S-0008R2-4D for submit@debbugs.gnu.org; Fri, 03 Mar 2023 12:15:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY90P-00088f-TG for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 12:15:42 -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 1pY90K-0002Kv-8A; Fri, 03 Mar 2023 12:15:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=wx3k6I+TwZTSEspzYlHGZ+NDl8Dp+fp4qbnVGbwvU7Q=; b=BwfRh3v7sYjDi7yGfmXP 4QBPEd98wWlkA36GWhFJOViCN3HKnNz7DYH8BI5snaCMfoFbvj0jxZqwMp8xRAjiEEtM21A9xn7nb dNHlvM6cHKORnyt3WIRolNBd09erJI+LnvuTXb6M+iVp8/DF3MOx/uCTkoi3KeFT8U7j+Y3bTBJ+W O+r1+VwKZpiRKH3Ga3EAUusAqET/AawiDMZwIhYNQvMX5ZTv3wAXllhvdMka60l2gi057zX9VMEkh vNimd+3+mPI8WbYD6wqo9DhWKaEZxLai1iPcSyqdNoTCHLsTLBLylJv8xzSYszcU+5sL5DWmWY+13 VJ3Rom4WOzGeNA==; Received: from [193.50.110.138] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pY90J-00071b-Rg; Fri, 03 Mar 2023 12:15:36 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal Subject: Re: bug#61587: [PATCH 0/8] networking services refactoring References: Date: Fri, 03 Mar 2023 18:15:33 +0100 In-Reply-To: (Bruno Victal's message of "Fri, 17 Feb 2023 21:14:58 +0000") Message-ID: <87o7p9u56y.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: 61587 Cc: 61587@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: -3.3 (---) Bruno Victal skribis: > (list (shepherd-service > (documentation "Run the NetworkManager.") > - (provision '(networking)) > + (provision '(NetworkManager networking)) We could discuss this at length, but I=E2=80=99m in favor of either the sta= tus quo, or: (provision '(networking network-manager)) WDYT? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 12:26:56 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 17:26:56 +0000 Received: from localhost ([127.0.0.1]:33881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY9BH-0000d6-LN for submit@debbugs.gnu.org; Fri, 03 Mar 2023 12:26:55 -0500 Received: from smtpm3.myservices.hosting ([185.26.105.234]:41086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY9BF-0000cy-Nf for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 12:26:55 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm3.myservices.hosting (Postfix) with ESMTP id 4BAC620FDA; Fri, 3 Mar 2023 18:26:52 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id E68848009A; Fri, 3 Mar 2023 18:26:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Zh2OmArbAb33; Fri, 3 Mar 2023 18:26:51 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 8249280098; Fri, 3 Mar 2023 18:26:51 +0100 (CET) Message-ID: Date: Fri, 3 Mar 2023 17:26:51 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: bug#61587: [PATCH 0/8] networking services refactoring Content-Language: en-US To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= References: <502d6efbde6d7e372ab6bc414fbbe2c065c23b4e.1676667941.git.mirai@makinata.eu> <87sfelu5a2.fsf_-_@gnu.org> From: Bruno Victal In-Reply-To: <87sfelu5a2.fsf_-_@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 61587 Cc: 61587@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: -2.1 (--) On 2023-03-03 17:13, Ludovic Courtès wrote:> Bruno Victal skribis: > >> Supersedes #47253. (Note: Shepherd no longer blocks since shepherd 0.9.3) > > What does that mean? Oops, I didn't intend to include this in the commit message, it was for the mail body. At the time I didn't notice that #47253 already had a patch to solve this issue which resulted in independent rewrite of the same fix. I only noticed it while I was searching for open issues to attach to the message as potential issues that would be closed by this. The note refers to what made #47253 untenable back then. >> * gnu/services/networking.scm (network-manager-shepherd-service): Await for >> NetworkManager to finish starting up. > > [...] > >> + (start >> + #~(lambda args >> + (let ((constructor >> + (apply >> + (make-forkexec-constructor >> + (list #$(file-append network-manager >> + "/sbin/NetworkManager") >> + (string-append "--config=" #$conf) >> + "--no-daemon") > > Rather: > > (let ((pid (fork+exec-command (list …)))) > … > pid) I'll send a v2 with the required touch-ups. Cheers, Bruno From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 12:29:32 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 17:29:32 +0000 Received: from localhost ([127.0.0.1]:33887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY9Do-0000h4-56 for submit@debbugs.gnu.org; Fri, 03 Mar 2023 12:29:32 -0500 Received: from smtpm1.myservices.hosting ([185.26.105.232]:51626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY9Dm-0000gv-58 for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 12:29:30 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm1.myservices.hosting (Postfix) with ESMTP id 3501020479; Fri, 3 Mar 2023 18:29:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 0295980097; Fri, 3 Mar 2023 18:20:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Enb4L8uRBdbd; Fri, 3 Mar 2023 18:20:11 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 94CCC80079; Fri, 3 Mar 2023 18:20:11 +0100 (CET) Message-ID: Date: Fri, 3 Mar 2023 17:20:03 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: bug#61587: [PATCH 0/8] networking services refactoring Content-Language: en-US To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= References: <87o7p9u56y.fsf_-_@gnu.org> From: Bruno Victal In-Reply-To: <87o7p9u56y.fsf_-_@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 61587 Cc: 61587@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: -2.1 (--) On 2023-03-03 17:15, Ludovic Courtès wrote: > Bruno Victal skribis: > >> (list (shepherd-service >> (documentation "Run the NetworkManager.") >> - (provision '(networking)) >> + (provision '(NetworkManager networking)) > > We could discuss this at length, but I’m in favor of either the status > quo, or: > > (provision '(networking network-manager)) > > WDYT? The ordering matters here, putting 'networking first means that 'network-manager is the virtual service and that something like connman can provide 'network-manager which is absurd. Cheers, Bruno From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 17:59:52 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 22:59:52 +0000 Received: from localhost ([127.0.0.1]:34135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENU-0000vw-A1 for submit@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:52 -0500 Received: from smtpm3.myservices.hosting ([185.26.105.234]:47148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENS-0000vV-P1 for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:51 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm3.myservices.hosting (Postfix) with ESMTP id 5C2542105E for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 013AF80098; Fri, 3 Mar 2023 23:59:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id bAX97-EFX6yc; Fri, 3 Mar 2023 23:59:45 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 83E9B80079; Fri, 3 Mar 2023 23:59:45 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v2 1/8] services: network-manager: Add 'shepherd-requirement' field. Date: Fri, 3 Mar 2023 22:59:06 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) Note: This also makes wpa-supplicant an optional requirement. * gnu/services/networking.scm () [shepherd-requirement]: New field. (network-manager-shepherd-service): Honor it. (network-manager-configuration-shepherd-requirement): Export accessor. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 6 ++++++ gnu/services/networking.scm | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 74658dbc86..4599c87a72 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19836,6 +19836,12 @@ Networking Setup @item @code{network-manager} (default: @code{network-manager}) The NetworkManager package to use. +@item @code{shepherd-requirement} (default: @code{()}) +This option can be used to provide a list of symbols naming Shepherd services +that this service will depend on, such as @code{'wpa-supplicant} or +@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet +networks. + @item @code{dns} (default: @code{"default"}) Processing mode for DNS, which affects how NetworkManager uses the @code{resolv.conf} configuration file. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index dacf64c2d1..5284855b83 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -143,6 +143,7 @@ (define-module (gnu services networking) network-manager-configuration network-manager-configuration? + network-manager-configuration-shepherd-requirement network-manager-configuration-dns network-manager-configuration-vpn-plugins network-manager-service-type @@ -1140,6 +1141,8 @@ (define-record-type* network-manager-configuration? (network-manager network-manager-configuration-network-manager (default network-manager)) + (shepherd-requirement network-manager-configuration-shepherd-requirement + (default '())) (dns network-manager-configuration-dns (default "default")) (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like @@ -1200,7 +1203,7 @@ (define (network-manager-environment config) (define (network-manager-shepherd-service config) (match-record config - (network-manager dns vpn-plugins iwd?) + (network-manager shepherd-requirement dns vpn-plugins iwd?) (let ((conf (plain-file "NetworkManager.conf" (string-append "[main]\ndns=" dns "\n" @@ -1209,8 +1212,9 @@ (define (network-manager-shepherd-service config) (list (shepherd-service (documentation "Run the NetworkManager.") (provision '(networking)) - (requirement (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '(wpa-supplicant)))) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$network-manager "/sbin/NetworkManager") base-commit: 6a1464b0cc8c0b3e53d2580661a8c69d79f183ab -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 17:59:53 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 22:59:53 +0000 Received: from localhost ([127.0.0.1]:34137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENU-0000vy-Ni for submit@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:53 -0500 Received: from smtpm2.myservices.hosting ([185.26.105.233]:37206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENS-0000vW-Nq for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:51 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm2.myservices.hosting (Postfix) with ESMTP id 056BD20E51 for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id B4A6880079; Fri, 3 Mar 2023 23:59:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3uA2vR7J3HV3; Fri, 3 Mar 2023 23:59:48 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 1F56680098; Fri, 3 Mar 2023 23:59:48 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v2 8/8] services: connman: Set service canonical-name to connman. Date: Fri, 3 Mar 2023 22:59:13 +0000 Message-Id: <1248e833d0f2cec6a0e794689c70f2427f9474ec.1677884353.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm (connman-shepherd-service): Make 'networking a virtual service and set 'connman as its canonical name. --- gnu/services/networking.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 66fd9121e0..680d6f6b4f 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1327,7 +1327,7 @@ (define (connman-shepherd-service config) (memq 'iwd shepherd-requirement))))) (list (shepherd-service (documentation "Run Connman") - (provision '(networking)) + (provision '(connman networking)) (requirement `(user-processes dbus-system loopback ,@shepherd-requirement ;; TODO: iwd? is deprecated and should be passed -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 17:59:53 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 22:59:53 +0000 Received: from localhost ([127.0.0.1]:34139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENV-0000w5-59 for submit@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:53 -0500 Received: from smtpm4.myservices.hosting ([185.26.105.235]:43432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENS-0000vU-P8 for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:51 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id A94DE20CA9 for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 5807080098; Fri, 3 Mar 2023 23:59:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yOOabzT89pdT; Fri, 3 Mar 2023 23:59:47 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id D11A680079; Fri, 3 Mar 2023 23:59:46 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v2 5/8] services: connman: Deprecate 'iwd?' field. Date: Fri, 3 Mar 2023 22:59:10 +0000 Message-Id: <180abb2c1c071f8cea0930518a38972e3fee5000.1677884353.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm () [iwd?]: Use helper to warn deprecated field. (connman-shepherd-service): Make iwd? a local variable independent from the deprecated field. * doc/guix.texi (Networking Setup): Remove mention of iwd? field. --- doc/guix.texi | 2 -- gnu/services/networking.scm | 50 +++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index dceef5cbd5..fcaa5f69be 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19926,8 +19926,6 @@ Networking Setup @item @code{disable-vpn?} (default: @code{#f}) When true, disable connman's vpn plugin. -@item @code{iwd?} (default: @code{#f}) -When true, ConnMan uses iwd to connect to wireless networks. @end table @end deftp diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 30a4d6a6d8..13816327b0 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1294,7 +1294,8 @@ (define-record-type* (disable-vpn? connman-configuration-disable-vpn? (default #f)) (iwd? connman-configuration-iwd? - (default #f))) + (default #f) + (sanitize warn-iwd?-field-deprecation))) (define (connman-activation config) (let ((disable-vpn? (connman-configuration-disable-vpn? config))) @@ -1308,27 +1309,32 @@ (define (connman-activation config) (define (connman-shepherd-service config) (match-record config (connman shepherd-requirement disable-vpn? iwd?) - (list (shepherd-service - (documentation "Run Connman") - (provision '(networking)) - (requirement `(user-processes dbus-system loopback - ,@shepherd-requirement - ,@(if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$connman - "/sbin/connmand") - "--nodaemon" - "--nodnsproxy" - #$@(if disable-vpn? '("--noplugin=vpn") '()) - #$@(if iwd? '("--wifi=iwd_agent") '())) - - ;; As connman(8) notes, when passing '-n', connman - ;; "directs log output to the controlling terminal in - ;; addition to syslog." Redirect stdout and stderr - ;; to avoid spamming the console (XXX: for some reason - ;; redirecting to /dev/null doesn't work.) - #:log-file "/var/log/connman.log")) - (stop #~(make-kill-destructor)))))) + (let ((iwd? (or iwd? ; TODO: deprecated field, remove later. + (and shepherd-requirement + (memq 'iwd shepherd-requirement))))) + (list (shepherd-service + (documentation "Run Connman") + (provision '(networking)) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ;; TODO: iwd? is deprecated and should be passed + ;; with shepherd-requirement, remove later. + ,@(if iwd? '(iwd) '()))) + (start #~(make-forkexec-constructor + (list (string-append #$connman + "/sbin/connmand") + "--nodaemon" + "--nodnsproxy" + #$@(if disable-vpn? '("--noplugin=vpn") '()) + #$@(if iwd? '("--wifi=iwd_agent") '())) + + ;; As connman(8) notes, when passing '-n', connman + ;; "directs log output to the controlling terminal in + ;; addition to syslog." Redirect stdout and stderr + ;; to avoid spamming the console (XXX: for some reason + ;; redirecting to /dev/null doesn't work.) + #:log-file "/var/log/connman.log")) + (stop #~(make-kill-destructor))))))) (define %connman-log-rotation (list (log-rotation -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 17:59:54 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 22:59:54 +0000 Received: from localhost ([127.0.0.1]:34141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENV-0000wD-KB for submit@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:53 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:36988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENS-0000vT-T0 for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:52 -0500 Received: from smtpmciv8.myservices.hosting (smtpmciv8.myservices.hosting [185.26.106.203]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 9706420825 for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:47 +0100 (CET) Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv8.myservices.hosting (Postfix) with ESMTP id 4DAE520817 for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id EDF008009A; Fri, 3 Mar 2023 23:59:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id NwUKIZaJcSO3; Fri, 3 Mar 2023 23:59:46 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 80C4A80097; Fri, 3 Mar 2023 23:59:46 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v2 4/8] services: connman: Add 'shepherd-requirement' field. Date: Fri, 3 Mar 2023 22:59:09 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm () [shepherd-requirement]: New field. (connman-shepherd-service): Honor it. (connman-configuration-shepherd-requirement): Export accessor. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 6 ++++++ gnu/services/networking.scm | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 00313c54e6..dceef5cbd5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19917,6 +19917,12 @@ Networking Setup @item @code{connman} (default: @var{connman}) The connman package to use. +@item @code{shepherd-requirement} (default: @code{()}) +This option can be used to provide a list of symbols naming Shepherd services +that this service will depend on, such as @code{'wpa-supplicant} or +@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet +networks. + @item @code{disable-vpn?} (default: @code{#f}) When true, disable connman's vpn plugin. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 5cba3a9a3f..30a4d6a6d8 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -151,6 +151,7 @@ (define-module (gnu services networking) connman-configuration connman-configuration? connman-configuration-connman + connman-configuration-shepherd-requirement connman-configuration-disable-vpn? connman-configuration-iwd? connman-service-type @@ -1288,6 +1289,8 @@ (define-record-type* connman-configuration? (connman connman-configuration-connman (default connman)) + (shepherd-requirement connman-configuration-shepherd-requirement + (default '())) (disable-vpn? connman-configuration-disable-vpn? (default #f)) (iwd? connman-configuration-iwd? @@ -1303,13 +1306,14 @@ (define (connman-activation config) (mkdir-p "/var/lib/connman-vpn/")))))) (define (connman-shepherd-service config) - (match-record config (connman disable-vpn? iwd?) + (match-record config (connman shepherd-requirement + disable-vpn? iwd?) (list (shepherd-service (documentation "Run Connman") (provision '(networking)) - (requirement - (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '()))) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$connman "/sbin/connmand") -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 17:59:58 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 22:59:58 +0000 Received: from localhost ([127.0.0.1]:34146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENa-0000wl-1C for submit@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:58 -0500 Received: from smtpm2.myservices.hosting ([185.26.105.233]:37222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENW-0000wP-Hn for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:55 -0500 Received: from smtpm6.myservices.hosting (smtpm6.myservices.hosting [185.26.105.207]) by smtpm2.myservices.hosting (Postfix) with ESMTP id D692520ECD for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:49 +0100 (CET) Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm6.myservices.hosting (Postfix) with ESMTP id 9C75B20BD4 for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 5031780079; Fri, 3 Mar 2023 23:59:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aMMDsrA5h1LI; Fri, 3 Mar 2023 23:59:47 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 2BBBB80097; Fri, 3 Mar 2023 23:59:47 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v2 6/8] services: network-manager: Await for NetworkManager to finish starting up. Date: Fri, 3 Mar 2023 22:59:11 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) This is similar to its NetworkManager-wait-online.service systemd counterpart, with the main difference being that we handle it all in 'networking symbol, rather than introduce a new 'networking-online symbol. (see discussion #47253) As a result of this change, with opensmtpd-service-type as an example, manual 'herd restart smtpd' after system bootups are no longer required when opensmtpd is configured with a smtpd.conf containing non-loopback interfaces. (this issue is described in more detail at #60300) Fixes . * gnu/services/networking.scm (network-manager-shepherd-service): Await for NetworkManager to finish starting up. --- gnu/services/networking.scm | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 13816327b0..76674f346a 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1235,17 +1235,30 @@ (define (network-manager-shepherd-service config) ;; TODO: iwd? is deprecated and should be passed ;; with shepherd-requirement, remove later. ,@(if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$network-manager - "/sbin/NetworkManager") - (string-append "--config=" #$conf) - "--no-daemon") - #:environment-variables - (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn - "/lib/NetworkManager/VPN") - ;; Override non-existent default users - "NM_OPENVPN_USER=" - "NM_OPENVPN_GROUP="))) + (start + #~(lambda _ + (let ((pid + (fork+exec-command + (list #$(file-append network-manager + "/sbin/NetworkManager") + (string-append "--config=" #$conf) + "--no-daemon") + #:environment-variables + (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn + "/lib/NetworkManager/VPN") + ;; Override non-existent default users + "NM_OPENVPN_USER=" + "NM_OPENVPN_GROUP=")))) + ;; XXX: Despite the "online" name, this doesn't guarantee + ;; WAN connectivity, it merely waits for NetworkManager + ;; to finish starting-up. This is required otherwise + ;; services will fail since the network interfaces be + ;; absent until NetworkManager finishes setting them up. + (system* #$(file-append network-manager "/bin/nm-online") + "--wait-for-startup" "--quiet") + ;; XXX: Finally, return the pid from running + ;; fork+exec-command to shepherd. + pid))) (stop #~(make-kill-destructor))))))) (define network-manager-service-type -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 17:59:58 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 22:59:59 +0000 Received: from localhost ([127.0.0.1]:34148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENa-0000wn-EF for submit@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:58 -0500 Received: from smtpm3.myservices.hosting ([185.26.105.234]:47162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENW-0000wR-Od for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:55 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm3.myservices.hosting (Postfix) with ESMTP id A7B9221063 for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 4BA278009A; Fri, 3 Mar 2023 23:59:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id sfgP7HU7Pl5p; Fri, 3 Mar 2023 23:59:46 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id D43AD80097; Fri, 3 Mar 2023 23:59:45 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v2 2/8] services: network-manager: Deprecate 'iwd?' field. Date: Fri, 3 Mar 2023 22:59:07 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm (warn-iwd?-field-deprecation): New procedure, helper for deprecated field. ()[iwd?]: Use helper to warn deprecated field. (network-manager-shepherd-service): Make iwd? a local variable independent from the deprecated field. * doc/guix.texi (Networking Setup): Remove mention of iwd? field. --- doc/guix.texi | 4 ---- gnu/services/networking.scm | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 4599c87a72..00313c54e6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19890,10 +19890,6 @@ Networking Setup (VPNs). An example of this is the @code{network-manager-openvpn} package, which allows NetworkManager to manage VPNs @i{via} OpenVPN. -@item @code{iwd?} (default: @code{#f}) -NetworkManager will use iwd as a backend for wireless networking if this -option is set to @code{#t}, otherwise it will use wpa-supplicant. - @end table @end deftp diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 5284855b83..ddf2e20791 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1136,6 +1136,15 @@ (define-record-type* ;;; NetworkManager ;;; +;; TODO: deprecated field, remove later. +(define-with-syntax-properties (warn-iwd?-field-deprecation + (value properties)) + (when value + (warning (source-properties->location properties) + (G_ "the 'iwd?' field is deprecated, please use \ +'shepherd-requirement' field instead~%"))) + value) + (define-record-type* network-manager-configuration make-network-manager-configuration network-manager-configuration? @@ -1147,7 +1156,9 @@ (define-record-type* (default "default")) (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like (default '())) - (iwd? network-manager-configuration-iwd? (default #f))) + (iwd? network-manager-configuration-iwd? ; TODO: deprecated field, remove. + (default #f) + (sanitize warn-iwd?-field-deprecation))) (define (network-manager-activation config) ;; Activation gexp for NetworkManager @@ -1204,7 +1215,10 @@ (define (network-manager-environment config) (define (network-manager-shepherd-service config) (match-record config (network-manager shepherd-requirement dns vpn-plugins iwd?) - (let ((conf (plain-file "NetworkManager.conf" + (let ((iwd? (or iwd? ; TODO: deprecated field, remove later. + (and shepherd-requirement + (memq 'iwd shepherd-requirement)))) + (conf (plain-file "NetworkManager.conf" (string-append "[main]\ndns=" dns "\n" (if iwd? "[device]\nwifi.backend=iwd\n" "")))) @@ -1214,6 +1228,8 @@ (define (network-manager-shepherd-service config) (provision '(networking)) (requirement `(user-processes dbus-system loopback ,@shepherd-requirement + ;; TODO: iwd? is deprecated and should be passed + ;; with shepherd-requirement, remove later. ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$network-manager -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 17:59:59 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 22:59:59 +0000 Received: from localhost ([127.0.0.1]:34151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENa-0000wy-Ux for submit@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:59 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:37008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENX-0000wZ-KW for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 17:59:56 -0500 Received: from smtpmciv8.myservices.hosting (smtpmciv8.myservices.hosting [185.26.106.203]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 301CD20921 for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:50 +0100 (CET) Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv8.myservices.hosting (Postfix) with ESMTP id DB4AF20817 for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 8540C8009A; Fri, 3 Mar 2023 23:59:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Hg6u2XOGXgbw; Fri, 3 Mar 2023 23:59:48 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 8274080079; Fri, 3 Mar 2023 23:59:47 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v2 7/8] services: network-manager: Set service canonical-name to NetworkManager. Date: Fri, 3 Mar 2023 22:59:12 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) According to the semantics in [1], 'networking should be a "virtual service" and NetworkManager its canonical-name. This does not influence existing services and they should continue to use the 'networking symbol. One visible change is that 'herd status' doesn't show 'networking' anymore, instead listing 'NetworkManager' in its place but both symbols are can be used to start and stop the same service. Note: Though the symbol NetworkManager doesn't really conform with the overall kebab-case used throughout Guix, this is intentional as we really want to make it clear that that the symbol NetworkManager really refers to the software called NetworkManager, since it's a canonical name here. (rather than risk misleading the user to interpret the symbol network-manager as a symbol for some unspecific network management software) [1]: https://www.gnu.org/software/shepherd/manual/html_node/Jump-Start.html * gnu/services/networking.scm (network-manager-shepherd-service): Make 'networking a virtual service and set 'NetworkManager as its canonical name. --- gnu/services/networking.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 76674f346a..66fd9121e0 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1229,7 +1229,7 @@ (define (network-manager-shepherd-service config) (vpn (vpn-plugin-directory vpn-plugins))) (list (shepherd-service (documentation "Run the NetworkManager.") - (provision '(networking)) + (provision '(NetworkManager networking)) (requirement `(user-processes dbus-system loopback ,@shepherd-requirement ;; TODO: iwd? is deprecated and should be passed -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 03 18:00:05 2023 Received: (at 61587) by debbugs.gnu.org; 3 Mar 2023 23:00:05 +0000 Received: from localhost ([127.0.0.1]:34155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENg-0000yD-EW for submit@debbugs.gnu.org; Fri, 03 Mar 2023 18:00:04 -0500 Received: from smtpm3.myservices.hosting ([185.26.105.234]:47176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYENa-0000ws-PH for 61587@debbugs.gnu.org; Fri, 03 Mar 2023 18:00:02 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm3.myservices.hosting (Postfix) with ESMTP id 1284821068 for <61587@debbugs.gnu.org>; Fri, 3 Mar 2023 23:59:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 9B47C80098; Fri, 3 Mar 2023 23:59:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id fWjT-VOV_dOx; Fri, 3 Mar 2023 23:59:46 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 2FC5D80079; Fri, 3 Mar 2023 23:59:46 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v2 3/8] services: connman: Use match-record and export accessors. Date: Fri, 3 Mar 2023 22:59:08 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: Bruno Victal 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 (-) * gnu/services/networking.scm (connman-shepherd-service): Use match-record. (connman-configuration-connman, connman-configuration-disable-vpn?) (connman-configuration-iwd?): Export accessors. --- gnu/services/networking.scm | 52 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index ddf2e20791..5cba3a9a3f 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -150,6 +150,9 @@ (define-module (gnu services networking) connman-configuration connman-configuration? + connman-configuration-connman + connman-configuration-disable-vpn? + connman-configuration-iwd? connman-service-type modem-manager-configuration @@ -1300,33 +1303,28 @@ (define (connman-activation config) (mkdir-p "/var/lib/connman-vpn/")))))) (define (connman-shepherd-service config) - "Return a shepherd service for Connman" - (and - (connman-configuration? config) - (let ((connman (connman-configuration-connman config)) - (disable-vpn? (connman-configuration-disable-vpn? config)) - (iwd? (connman-configuration-iwd? config))) - (list (shepherd-service - (documentation "Run Connman") - (provision '(networking)) - (requirement - (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$connman - "/sbin/connmand") - "--nodaemon" - "--nodnsproxy" - #$@(if disable-vpn? '("--noplugin=vpn") '()) - #$@(if iwd? '("--wifi=iwd_agent") '())) - - ;; As connman(8) notes, when passing '-n', connman - ;; "directs log output to the controlling terminal in - ;; addition to syslog." Redirect stdout and stderr - ;; to avoid spamming the console (XXX: for some reason - ;; redirecting to /dev/null doesn't work.) - #:log-file "/var/log/connman.log")) - (stop #~(make-kill-destructor))))))) + (match-record config (connman disable-vpn? iwd?) + (list (shepherd-service + (documentation "Run Connman") + (provision '(networking)) + (requirement + (append '(user-processes dbus-system loopback) + (if iwd? '(iwd) '()))) + (start #~(make-forkexec-constructor + (list (string-append #$connman + "/sbin/connmand") + "--nodaemon" + "--nodnsproxy" + #$@(if disable-vpn? '("--noplugin=vpn") '()) + #$@(if iwd? '("--wifi=iwd_agent") '())) + + ;; As connman(8) notes, when passing '-n', connman + ;; "directs log output to the controlling terminal in + ;; addition to syslog." Redirect stdout and stderr + ;; to avoid spamming the console (XXX: for some reason + ;; redirecting to /dev/null doesn't work.) + #:log-file "/var/log/connman.log")) + (stop #~(make-kill-destructor)))))) (define %connman-log-rotation (list (log-rotation -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 06 10:20:31 2023 Received: (at 61587) by debbugs.gnu.org; 6 Mar 2023 15:20:31 +0000 Received: from localhost ([127.0.0.1]:43328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZCdb-0000pb-B8 for submit@debbugs.gnu.org; Mon, 06 Mar 2023 10:20:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZCdY-0000pM-Tx for 61587@debbugs.gnu.org; Mon, 06 Mar 2023 10:20:30 -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 1pZCdT-0007UD-9K; Mon, 06 Mar 2023 10:20:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=VpTW+qtQa9ikww2Tq2QeWPgQJURPfvjU/jV5GBgkfwM=; b=lsh3jzFgT9W0yTbAkxKD KKzN7VtVvESMyLnAeCzHUi3rZeP4w8jmzA9kXRzPJG8T0CGmshYopnrO8419NZZSeHm5tPkuV8LJe X0er0KdAk/gXz+C4wfpPKlLHPYst42xnl416LgZrbzxZ4c3WEwb+PzpqepAR6F6e8uoANxE2Wsu+t BR0U43oDTLV14J998VfRCSnNjRCkM0IUZbK7rKvkf+iU22lDua8M212DcOEA7fBrSYx9Un3sggbxD h3wihmE/JQF5dYLUmmVlvvIyGuRWRDSdX2SlLc0SLQ2viTf2mwWYEa8Lthy6skqwB5h9SuEXtZ+1c 9gSV0DLi3P2bVg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZCdS-0002A4-SH; Mon, 06 Mar 2023 10:20:23 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal Subject: Re: bug#61587: [PATCH 0/8] networking services refactoring References: <87o7p9u56y.fsf_-_@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Sextidi 16 =?utf-8?Q?Vent=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de =?utf-8?Q?l'=C3=89pinard?= 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: Mon, 06 Mar 2023 16:20:19 +0100 In-Reply-To: (Bruno Victal's message of "Fri, 3 Mar 2023 17:20:03 +0000") Message-ID: <877cvtc3f0.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: 61587 Cc: 61587@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: -3.3 (---) Bruno Victal skribis: > On 2023-03-03 17:15, Ludovic Court=C3=A8s wrote: >> Bruno Victal skribis: >>=20 >>> (list (shepherd-service >>> (documentation "Run the NetworkManager.") >>> - (provision '(networking)) >>> + (provision '(NetworkManager networking)) >>=20 >> We could discuss this at length, but I=E2=80=99m in favor of either the = status >> quo, or: >>=20 >> (provision '(networking network-manager)) >>=20 >> WDYT? > > The ordering matters here, putting 'networking first means that 'network-= manager is the virtual service and that something like > connman can provide 'network-manager which is absurd. Hmm OK, I don=E2=80=99t mind the ordering. In the Shepherd there=E2=80=99s really the =E2=80=9Ccanonical name=E2=80=9D= and =E2=80=9Cother names=E2=80=9D; that=E2=80=99s all ordering changes. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 05:01:45 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 10:01:45 +0000 Received: from localhost ([127.0.0.1]:44499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZU8f-0003ok-48 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 05:01:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZU8d-0003oM-VY for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 05:01:44 -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 1pZU8U-00006k-AV; Tue, 07 Mar 2023 05:01:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=obvBUs7mNOoDI09QByYW1oYjxm7JoSYhNCjf+WHhHVo=; b=OyQNvBfndk7KioLgI/N3 yqlNcejn2pscETPSrLg64m7dRyAnQYc0YkzQwe/XSOzoKmM5JGoTGDeoR/CQqvXX/Mh6sqXpw9OpK aaVb0BdinYvOgTJHk1gCKOZ9qToW/SBXHEIk8A607fqGewGT/xXmT76WVTaMSDSq+cjkHmeK0EZRm fMo8w3t378p+yXDLVfRa+1Isk5l99YWwVSP+GdzGrlj9Il6wvxb6xxgVQ9BZT4rK9ZAFSd3DK1jS1 GGfSZaIHbCdK+X3HYnfVzBMiHq06RoXHHcLlMlvpki+NzLIMLkRxWC+Z85M/FdQI0wJxhmxfH5oPw SLeFsxJQR94tOg==; Received: from [193.50.110.138] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZU8T-00012r-El; Tue, 07 Mar 2023 05:01:33 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal Subject: Re: bug#61587: [PATCH 0/8] networking services refactoring References: Date: Tue, 07 Mar 2023 11:01:30 +0100 In-Reply-To: (Bruno Victal's message of "Fri, 3 Mar 2023 22:59:06 +0000") Message-ID: <87bkl4ev7p.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: 61587 Cc: 61587@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: -3.3 (---) Hi, Bruno Victal skribis: > Note: This also makes wpa-supplicant an optional requirement. > > * gnu/services/networking.scm () > [shepherd-requirement]: New field. > (network-manager-shepherd-service): Honor it. > (network-manager-configuration-shepherd-requirement): Export accessor. > * doc/guix.texi (Networking Setup): Document it. [...] > +@item @code{shepherd-requirement} (default: @code{()}) > +This option can be used to provide a list of symbols naming Shepherd ser= vices > +that this service will depend on, such as @code{'wpa-supplicant} or > +@code{'iwd} if you require authenticated access for encrypted WiFi or Et= hernet > +networks. For clarity, I=E2=80=99d write the list: @code{'(wpa-supplicant)}. > + (shepherd-requirement network-manager-configuration-shepherd-requireme= nt > + (default '())) [...] > - (requirement (append '(user-processes dbus-system loopback) > - (if iwd? '(iwd) '(wpa-supplicant)))) > + (requirement `(user-processes dbus-system loopback > + ,@shepherd-requirement > + ,@(if iwd? '(iwd) '()))) To preserve backward compatibility and to provide a reasonable default (with working WiFi), I think the default for =E2=80=98shepherd-requirement= =E2=80=99 should be '(wpa-supplicant) rather than the empty list. (BTW, it seems that wpa-supplicant can be DBus-activated, maybe that=E2=80= =99s what we should do instead? But let=E2=80=99s forget about it for this patch series.) Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 05:04:41 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 10:04:41 +0000 Received: from localhost ([127.0.0.1]:44515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZUBV-0003td-4i for submit@debbugs.gnu.org; Tue, 07 Mar 2023 05:04:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZUBT-0003tO-7s for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 05:04:39 -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 1pZUBO-0000RP-1A; Tue, 07 Mar 2023 05:04:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=9qj/3TSTJx+m8Qjpxut5rsT1hEPhxfpsfpc+WysE/GM=; b=MxoMwg+5/HMPTYYnwI41 Z+MAGFCbfJrvgrSf/XVikg7yB0np9d15FVBVWKR1eg9dLlgJVyqFmcSSZUZUws7cXQDD4P4yTF0lG mBafGIAso36tRNb6NzmvUdS2Npbf7ndrOgSM2D993GLkOrOcxFS8bQfs6XU7DBqAgcN+4dDf3ihXN dx3kcR4Xd2xDnQ26TeBbDhFX0OViygm3Ey7H9Wt+XK7fZvomQTBKti2gEg2XtQO3x1Q74RX3b9Tp3 HY4ercEiftXQU+zpoHswSkWJzMV1TQYzmbyvLJor5vaU+0f6iW+ugt6XLDEp14GYsu8wHv/2+XZhk 7QAEIBoV0CC01Q==; Received: from [193.50.110.138] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZUBN-00025H-IO; Tue, 07 Mar 2023 05:04:33 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal Subject: Re: bug#61587: [PATCH 0/8] networking services refactoring References: <87bkl4ev7p.fsf_-_@gnu.org> Date: Tue, 07 Mar 2023 11:04:32 +0100 In-Reply-To: <87bkl4ev7p.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Tue, 07 Mar 2023 11:01:30 +0100") Message-ID: <877cvsev2n.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: 61587 Cc: 61587@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: -3.3 (---) Hi, Ludovic Court=C3=A8s skribis: > Bruno Victal skribis: > >> Note: This also makes wpa-supplicant an optional requirement. >> >> * gnu/services/networking.scm () >> [shepherd-requirement]: New field. >> (network-manager-shepherd-service): Honor it. >> (network-manager-configuration-shepherd-requirement): Export accessor. >> * doc/guix.texi (Networking Setup): Document it. > > [...] > >> +@item @code{shepherd-requirement} (default: @code{()}) >> +This option can be used to provide a list of symbols naming Shepherd se= rvices >> +that this service will depend on, such as @code{'wpa-supplicant} or >> +@code{'iwd} if you require authenticated access for encrypted WiFi or E= thernet >> +networks. > > For clarity, I=E2=80=99d write the list: @code{'(wpa-supplicant)}. > >> + (shepherd-requirement network-manager-configuration-shepherd-requirem= ent >> + (default '())) > > [...] > >> - (requirement (append '(user-processes dbus-system loopback) >> - (if iwd? '(iwd) '(wpa-supplicant)))) >> + (requirement `(user-processes dbus-system loopback >> + ,@shepherd-requirement >> + ,@(if iwd? '(iwd) '()))) > > To preserve backward compatibility and to provide a reasonable default > (with working WiFi), I think the default for =E2=80=98shepherd-requiremen= t=E2=80=99 > should be '(wpa-supplicant) rather than the empty list. The rest of the patch series (v2) LGTM. You can send an updated version of the patch above or I can fix it up on your behalf. Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 07:44:23 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 12:44:23 +0000 Received: from localhost ([127.0.0.1]:44715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWg3-000298-A9 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:23 -0500 Received: from smtpm1.myservices.hosting ([185.26.105.232]:49162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWg0-00028q-PZ for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:21 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm1.myservices.hosting (Postfix) with ESMTP id 737FF202E5; Tue, 7 Mar 2023 13:44:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 2BE25800B3; Tue, 7 Mar 2023 13:44:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 71XQZfFAYnYG; Tue, 7 Mar 2023 13:44:18 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id A2C9A800AA; Tue, 7 Mar 2023 13:44:18 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v3 1/8] services: network-manager: Add 'shepherd-requirement' field. Date: Tue, 7 Mar 2023 12:43:58 +0000 Message-Id: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: ludo@gnu.org, Bruno Victal 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 (-) Note: This also makes wpa-supplicant an optional requirement. * gnu/services/networking.scm () [shepherd-requirement]: New field. (network-manager-shepherd-service): Honor it. (network-manager-configuration-shepherd-requirement): Export accessor. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 6 ++++++ gnu/services/networking.scm | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 6671ba9305..ed518cbcb8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19836,6 +19836,12 @@ Networking Setup @item @code{network-manager} (default: @code{network-manager}) The NetworkManager package to use. +@item @code{shepherd-requirement} (default: @code{'(wpa-supplicant)}) +This option can be used to provide a list of symbols naming Shepherd services +that this service will depend on, such as @code{'wpa-supplicant} or +@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet +networks. + @item @code{dns} (default: @code{"default"}) Processing mode for DNS, which affects how NetworkManager uses the @code{resolv.conf} configuration file. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index dacf64c2d1..4a3d5b887f 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -143,6 +143,7 @@ (define-module (gnu services networking) network-manager-configuration network-manager-configuration? + network-manager-configuration-shepherd-requirement network-manager-configuration-dns network-manager-configuration-vpn-plugins network-manager-service-type @@ -1140,6 +1141,8 @@ (define-record-type* network-manager-configuration? (network-manager network-manager-configuration-network-manager (default network-manager)) + (shepherd-requirement network-manager-configuration-shepherd-requirement + (default '(wpa-supplicant))) (dns network-manager-configuration-dns (default "default")) (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like @@ -1200,7 +1203,7 @@ (define (network-manager-environment config) (define (network-manager-shepherd-service config) (match-record config - (network-manager dns vpn-plugins iwd?) + (network-manager shepherd-requirement dns vpn-plugins iwd?) (let ((conf (plain-file "NetworkManager.conf" (string-append "[main]\ndns=" dns "\n" @@ -1209,8 +1212,9 @@ (define (network-manager-shepherd-service config) (list (shepherd-service (documentation "Run the NetworkManager.") (provision '(networking)) - (requirement (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '(wpa-supplicant)))) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$network-manager "/sbin/NetworkManager") -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 07:44:24 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 12:44:24 +0000 Received: from localhost ([127.0.0.1]:44717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWg3-00029C-Kz for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:24 -0500 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:55220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWg1-00028r-BT for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:22 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id DAC5A20600; Tue, 7 Mar 2023 13:44:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 8CCBE800B4; Tue, 7 Mar 2023 13:44:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Bda9B0ncRXjN; Tue, 7 Mar 2023 13:44:19 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 14BFC800B2; Tue, 7 Mar 2023 13:44:19 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v3 2/8] services: network-manager: Deprecate 'iwd?' field. Date: Tue, 7 Mar 2023 12:43:59 +0000 Message-Id: <8c5655db8e1f5025a20af9f2de9bd4f91ef8afaa.1678193024.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> References: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: ludo@gnu.org, Bruno Victal 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 (-) * gnu/services/networking.scm (warn-iwd?-field-deprecation): New procedure, helper for deprecated field. ()[iwd?]: Use helper to warn deprecated field. (network-manager-shepherd-service): Make iwd? a local variable independent from the deprecated field. * doc/guix.texi (Networking Setup): Remove mention of iwd? field. --- doc/guix.texi | 4 ---- gnu/services/networking.scm | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ed518cbcb8..ccaca0a71b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19890,10 +19890,6 @@ Networking Setup (VPNs). An example of this is the @code{network-manager-openvpn} package, which allows NetworkManager to manage VPNs @i{via} OpenVPN. -@item @code{iwd?} (default: @code{#f}) -NetworkManager will use iwd as a backend for wireless networking if this -option is set to @code{#t}, otherwise it will use wpa-supplicant. - @end table @end deftp diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 4a3d5b887f..f572de1279 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1136,6 +1136,15 @@ (define-record-type* ;;; NetworkManager ;;; +;; TODO: deprecated field, remove later. +(define-with-syntax-properties (warn-iwd?-field-deprecation + (value properties)) + (when value + (warning (source-properties->location properties) + (G_ "the 'iwd?' field is deprecated, please use \ +'shepherd-requirement' field instead~%"))) + value) + (define-record-type* network-manager-configuration make-network-manager-configuration network-manager-configuration? @@ -1147,7 +1156,9 @@ (define-record-type* (default "default")) (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like (default '())) - (iwd? network-manager-configuration-iwd? (default #f))) + (iwd? network-manager-configuration-iwd? ; TODO: deprecated field, remove. + (default #f) + (sanitize warn-iwd?-field-deprecation))) (define (network-manager-activation config) ;; Activation gexp for NetworkManager @@ -1204,7 +1215,10 @@ (define (network-manager-environment config) (define (network-manager-shepherd-service config) (match-record config (network-manager shepherd-requirement dns vpn-plugins iwd?) - (let ((conf (plain-file "NetworkManager.conf" + (let ((iwd? (or iwd? ; TODO: deprecated field, remove later. + (and shepherd-requirement + (memq 'iwd shepherd-requirement)))) + (conf (plain-file "NetworkManager.conf" (string-append "[main]\ndns=" dns "\n" (if iwd? "[device]\nwifi.backend=iwd\n" "")))) @@ -1214,6 +1228,8 @@ (define (network-manager-shepherd-service config) (provision '(networking)) (requirement `(user-processes dbus-system loopback ,@shepherd-requirement + ;; TODO: iwd? is deprecated and should be passed + ;; with shepherd-requirement, remove later. ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$network-manager -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 07:44:27 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 12:44:27 +0000 Received: from localhost ([127.0.0.1]:44721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWg7-00029c-2S for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:27 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:41814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWg4-00029B-6D for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:24 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 3B5AD20A0A; Tue, 7 Mar 2023 13:44:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id EDF8C800B3; Tue, 7 Mar 2023 13:44:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JrK7MKTfWsVM; Tue, 7 Mar 2023 13:44:19 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7353E800AA; Tue, 7 Mar 2023 13:44:19 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v3 3/8] services: connman: Use match-record and export accessors. Date: Tue, 7 Mar 2023 12:44:00 +0000 Message-Id: <3e5fdee5dd2a6c1a7f59f8b5914b0a391e31f8b0.1678193024.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> References: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: ludo@gnu.org, Bruno Victal 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 (-) * gnu/services/networking.scm (connman-shepherd-service): Use match-record. (connman-configuration-connman, connman-configuration-disable-vpn?) (connman-configuration-iwd?): Export accessors. --- gnu/services/networking.scm | 52 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index f572de1279..abfaba8004 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -150,6 +150,9 @@ (define-module (gnu services networking) connman-configuration connman-configuration? + connman-configuration-connman + connman-configuration-disable-vpn? + connman-configuration-iwd? connman-service-type modem-manager-configuration @@ -1300,33 +1303,28 @@ (define (connman-activation config) (mkdir-p "/var/lib/connman-vpn/")))))) (define (connman-shepherd-service config) - "Return a shepherd service for Connman" - (and - (connman-configuration? config) - (let ((connman (connman-configuration-connman config)) - (disable-vpn? (connman-configuration-disable-vpn? config)) - (iwd? (connman-configuration-iwd? config))) - (list (shepherd-service - (documentation "Run Connman") - (provision '(networking)) - (requirement - (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$connman - "/sbin/connmand") - "--nodaemon" - "--nodnsproxy" - #$@(if disable-vpn? '("--noplugin=vpn") '()) - #$@(if iwd? '("--wifi=iwd_agent") '())) - - ;; As connman(8) notes, when passing '-n', connman - ;; "directs log output to the controlling terminal in - ;; addition to syslog." Redirect stdout and stderr - ;; to avoid spamming the console (XXX: for some reason - ;; redirecting to /dev/null doesn't work.) - #:log-file "/var/log/connman.log")) - (stop #~(make-kill-destructor))))))) + (match-record config (connman disable-vpn? iwd?) + (list (shepherd-service + (documentation "Run Connman") + (provision '(networking)) + (requirement + (append '(user-processes dbus-system loopback) + (if iwd? '(iwd) '()))) + (start #~(make-forkexec-constructor + (list (string-append #$connman + "/sbin/connmand") + "--nodaemon" + "--nodnsproxy" + #$@(if disable-vpn? '("--noplugin=vpn") '()) + #$@(if iwd? '("--wifi=iwd_agent") '())) + + ;; As connman(8) notes, when passing '-n', connman + ;; "directs log output to the controlling terminal in + ;; addition to syslog." Redirect stdout and stderr + ;; to avoid spamming the console (XXX: for some reason + ;; redirecting to /dev/null doesn't work.) + #:log-file "/var/log/connman.log")) + (stop #~(make-kill-destructor)))))) (define %connman-log-rotation (list (log-rotation -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 07:44:29 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 12:44:29 +0000 Received: from localhost ([127.0.0.1]:44724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWg8-00029m-Ht for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:29 -0500 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:55242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWg6-00029U-0D for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:26 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id B699520721; Tue, 7 Mar 2023 13:44:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 73937800B4; Tue, 7 Mar 2023 13:44:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 71etxwvfR6MG; Tue, 7 Mar 2023 13:44:20 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id DA2C6800B2; Tue, 7 Mar 2023 13:44:19 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v3 4/8] services: connman: Add 'shepherd-requirement' field. Date: Tue, 7 Mar 2023 12:44:01 +0000 Message-Id: <005b74725f5047fbf5e6ef1a5d5aba72bee79023.1678193024.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> References: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: ludo@gnu.org, Bruno Victal 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 (-) * gnu/services/networking.scm () [shepherd-requirement]: New field. (connman-shepherd-service): Honor it. (connman-configuration-shepherd-requirement): Export accessor. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 6 ++++++ gnu/services/networking.scm | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ccaca0a71b..ece0c0354d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19917,6 +19917,12 @@ Networking Setup @item @code{connman} (default: @var{connman}) The connman package to use. +@item @code{shepherd-requirement} (default: @code{()}) +This option can be used to provide a list of symbols naming Shepherd services +that this service will depend on, such as @code{'wpa-supplicant} or +@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet +networks. + @item @code{disable-vpn?} (default: @code{#f}) When true, disable connman's vpn plugin. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index abfaba8004..6a09f6e728 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -151,6 +151,7 @@ (define-module (gnu services networking) connman-configuration connman-configuration? connman-configuration-connman + connman-configuration-shepherd-requirement connman-configuration-disable-vpn? connman-configuration-iwd? connman-service-type @@ -1288,6 +1289,8 @@ (define-record-type* connman-configuration? (connman connman-configuration-connman (default connman)) + (shepherd-requirement connman-configuration-shepherd-requirement + (default '())) (disable-vpn? connman-configuration-disable-vpn? (default #f)) (iwd? connman-configuration-iwd? @@ -1303,13 +1306,14 @@ (define (connman-activation config) (mkdir-p "/var/lib/connman-vpn/")))))) (define (connman-shepherd-service config) - (match-record config (connman disable-vpn? iwd?) + (match-record config (connman shepherd-requirement + disable-vpn? iwd?) (list (shepherd-service (documentation "Run Connman") (provision '(networking)) - (requirement - (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '()))) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$connman "/sbin/connmand") -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 07:44:30 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 12:44:30 +0000 Received: from localhost ([127.0.0.1]:44726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWgA-0002A1-20 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:30 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:41830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWg8-00029k-AM for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:28 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 0119E20A1E; Tue, 7 Mar 2023 13:44:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id B1974800B3; Tue, 7 Mar 2023 13:44:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZgaUG2d-LJ8A; Tue, 7 Mar 2023 13:44:21 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 245F6800AA; Tue, 7 Mar 2023 13:44:21 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v3 7/8] services: network-manager: Set service canonical-name to NetworkManager. Date: Tue, 7 Mar 2023 12:44:04 +0000 Message-Id: <3f1007df629b9710e32b7d699936b02354f3e32d.1678193024.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> References: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: ludo@gnu.org, Bruno Victal 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 (-) According to the semantics in [1], 'networking should be a "virtual service" and NetworkManager its canonical-name. This does not influence existing services and they should continue to use the 'networking symbol. One visible change is that 'herd status' doesn't show 'networking' anymore, instead listing 'NetworkManager' in its place but both symbols are can be used to start and stop the same service. Note: Though the symbol NetworkManager doesn't really conform with the overall kebab-case used throughout Guix, this is intentional as we really want to make it clear that that the symbol NetworkManager really refers to the software called NetworkManager, since it's a canonical name here. (rather than risk misleading the user to interpret the symbol network-manager as a symbol for some unspecific network management software) [1]: https://www.gnu.org/software/shepherd/manual/html_node/Jump-Start.html * gnu/services/networking.scm (network-manager-shepherd-service): Make 'networking a virtual service and set 'NetworkManager as its canonical name. --- gnu/services/networking.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 7cf92dc8c4..5899e0977b 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1229,7 +1229,7 @@ (define (network-manager-shepherd-service config) (vpn (vpn-plugin-directory vpn-plugins))) (list (shepherd-service (documentation "Run the NetworkManager.") - (provision '(networking)) + (provision '(NetworkManager networking)) (requirement `(user-processes dbus-system loopback ,@shepherd-requirement ;; TODO: iwd? is deprecated and should be passed -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 07:44:34 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 12:44:34 +0000 Received: from localhost ([127.0.0.1]:44729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWgE-0002AI-Es for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:34 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:41846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWgC-0002AA-5j for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 07:44:33 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 9A16920A6A; Tue, 7 Mar 2023 13:44:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 55B0B800B3; Tue, 7 Mar 2023 13:44:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id M17M762Bmy-I; Tue, 7 Mar 2023 13:44:20 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id AEC2B800B2; Tue, 7 Mar 2023 13:44:20 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v3 6/8] services: network-manager: Await for NetworkManager to finish starting up. Date: Tue, 7 Mar 2023 12:44:03 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> References: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: ludo@gnu.org, Bruno Victal 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 (-) This is similar to its NetworkManager-wait-online.service systemd counterpart, with the main difference being that we handle it all in 'networking symbol, rather than introduce a new 'networking-online symbol. (see discussion #47253) As a result of this change, with opensmtpd-service-type as an example, manual 'herd restart smtpd' after system bootups are no longer required when opensmtpd is configured with a smtpd.conf containing non-loopback interfaces. (this issue is described in more detail at #60300) Fixes . * gnu/services/networking.scm (network-manager-shepherd-service): Await for NetworkManager to finish starting up. --- gnu/services/networking.scm | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 0ed467f9d8..7cf92dc8c4 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1235,17 +1235,30 @@ (define (network-manager-shepherd-service config) ;; TODO: iwd? is deprecated and should be passed ;; with shepherd-requirement, remove later. ,@(if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$network-manager - "/sbin/NetworkManager") - (string-append "--config=" #$conf) - "--no-daemon") - #:environment-variables - (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn - "/lib/NetworkManager/VPN") - ;; Override non-existent default users - "NM_OPENVPN_USER=" - "NM_OPENVPN_GROUP="))) + (start + #~(lambda _ + (let ((pid + (fork+exec-command + (list #$(file-append network-manager + "/sbin/NetworkManager") + (string-append "--config=" #$conf) + "--no-daemon") + #:environment-variables + (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn + "/lib/NetworkManager/VPN") + ;; Override non-existent default users + "NM_OPENVPN_USER=" + "NM_OPENVPN_GROUP=")))) + ;; XXX: Despite the "online" name, this doesn't guarantee + ;; WAN connectivity, it merely waits for NetworkManager + ;; to finish starting-up. This is required otherwise + ;; services will fail since the network interfaces be + ;; absent until NetworkManager finishes setting them up. + (system* #$(file-append network-manager "/bin/nm-online") + "--wait-for-startup" "--quiet") + ;; XXX: Finally, return the pid from running + ;; fork+exec-command to shepherd. + pid))) (stop #~(make-kill-destructor))))))) (define network-manager-service-type -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 07:49:31 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 12:49:31 +0000 Received: from localhost ([127.0.0.1]:44742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWl1-0002NL-IG for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:49:31 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:42792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWkz-0002ND-La for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 07:49:30 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id A4DE720A0A; Tue, 7 Mar 2023 13:49:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id CAC9A800B5; Tue, 7 Mar 2023 13:44:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id oH2fEXyezFpK; Tue, 7 Mar 2023 13:44:20 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 4B41C800AA; Tue, 7 Mar 2023 13:44:20 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v3 5/8] services: connman: Deprecate 'iwd?' field. Date: Tue, 7 Mar 2023 12:44:02 +0000 Message-Id: <8f687a369c103cafa671284edcaecc9fa0b2766c.1678193024.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> References: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: ludo@gnu.org, Bruno Victal 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 (-) * gnu/services/networking.scm () [iwd?]: Use helper to warn deprecated field. (connman-shepherd-service): Make iwd? a local variable independent from the deprecated field. * doc/guix.texi (Networking Setup): Remove mention of iwd? field. --- doc/guix.texi | 2 -- gnu/services/networking.scm | 50 +++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ece0c0354d..b098e45a50 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19926,8 +19926,6 @@ Networking Setup @item @code{disable-vpn?} (default: @code{#f}) When true, disable connman's vpn plugin. -@item @code{iwd?} (default: @code{#f}) -When true, ConnMan uses iwd to connect to wireless networks. @end table @end deftp diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 6a09f6e728..0ed467f9d8 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1294,7 +1294,8 @@ (define-record-type* (disable-vpn? connman-configuration-disable-vpn? (default #f)) (iwd? connman-configuration-iwd? - (default #f))) + (default #f) + (sanitize warn-iwd?-field-deprecation))) (define (connman-activation config) (let ((disable-vpn? (connman-configuration-disable-vpn? config))) @@ -1308,27 +1309,32 @@ (define (connman-activation config) (define (connman-shepherd-service config) (match-record config (connman shepherd-requirement disable-vpn? iwd?) - (list (shepherd-service - (documentation "Run Connman") - (provision '(networking)) - (requirement `(user-processes dbus-system loopback - ,@shepherd-requirement - ,@(if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$connman - "/sbin/connmand") - "--nodaemon" - "--nodnsproxy" - #$@(if disable-vpn? '("--noplugin=vpn") '()) - #$@(if iwd? '("--wifi=iwd_agent") '())) - - ;; As connman(8) notes, when passing '-n', connman - ;; "directs log output to the controlling terminal in - ;; addition to syslog." Redirect stdout and stderr - ;; to avoid spamming the console (XXX: for some reason - ;; redirecting to /dev/null doesn't work.) - #:log-file "/var/log/connman.log")) - (stop #~(make-kill-destructor)))))) + (let ((iwd? (or iwd? ; TODO: deprecated field, remove later. + (and shepherd-requirement + (memq 'iwd shepherd-requirement))))) + (list (shepherd-service + (documentation "Run Connman") + (provision '(networking)) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ;; TODO: iwd? is deprecated and should be passed + ;; with shepherd-requirement, remove later. + ,@(if iwd? '(iwd) '()))) + (start #~(make-forkexec-constructor + (list (string-append #$connman + "/sbin/connmand") + "--nodaemon" + "--nodnsproxy" + #$@(if disable-vpn? '("--noplugin=vpn") '()) + #$@(if iwd? '("--wifi=iwd_agent") '())) + + ;; As connman(8) notes, when passing '-n', connman + ;; "directs log output to the controlling terminal in + ;; addition to syslog." Redirect stdout and stderr + ;; to avoid spamming the console (XXX: for some reason + ;; redirecting to /dev/null doesn't work.) + #:log-file "/var/log/connman.log")) + (stop #~(make-kill-destructor))))))) (define %connman-log-rotation (list (log-rotation -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 07:59:33 2023 Received: (at 61587) by debbugs.gnu.org; 7 Mar 2023 12:59:33 +0000 Received: from localhost ([127.0.0.1]:44767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWui-0002dJ-Qt for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:59:33 -0500 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]:59686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWug-0002dB-W6 for 61587@debbugs.gnu.org; Tue, 07 Mar 2023 07:59:31 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id 4D66A20D93; Tue, 7 Mar 2023 13:59:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id E379A800AA; Tue, 7 Mar 2023 13:44:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id fhhBM0B54ope; Tue, 7 Mar 2023 13:44:23 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 8097D800B6; Tue, 7 Mar 2023 13:44:21 +0100 (CET) From: Bruno Victal To: 61587@debbugs.gnu.org Subject: [PATCH v3 8/8] services: connman: Set service canonical-name to connman. Date: Tue, 7 Mar 2023 12:44:05 +0000 Message-Id: <123b165c38744636b332ec699d16ac0314d61021.1678193024.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> References: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61587 Cc: ludo@gnu.org, Bruno Victal 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 (-) * gnu/services/networking.scm (connman-shepherd-service): Make 'networking a virtual service and set 'connman as its canonical name. --- gnu/services/networking.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 5899e0977b..5c6ad4ce3b 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1327,7 +1327,7 @@ (define (connman-shepherd-service config) (memq 'iwd shepherd-requirement))))) (list (shepherd-service (documentation "Run Connman") - (provision '(networking)) + (provision '(connman networking)) (requirement `(user-processes dbus-system loopback ,@shepherd-requirement ;; TODO: iwd? is deprecated and should be passed -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 08:21:51 2023 Received: (at 61587-done) by debbugs.gnu.org; 10 Mar 2023 13:21:51 +0000 Received: from localhost ([127.0.0.1]:54054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pacgw-0001Td-W5 for submit@debbugs.gnu.org; Fri, 10 Mar 2023 08:21:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pacgu-0001TO-EG for 61587-done@debbugs.gnu.org; Fri, 10 Mar 2023 08:21:48 -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 1pacgo-0006vz-8Y; Fri, 10 Mar 2023 08:21:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=4uB4OMy2XZ0loJFqRLGHvLmuf/i4OOmby6cyVTfJZjs=; b=P7pSshijHlLTL3n7MMgI VWgvl5jy0VF7eE70WuLGWUt41Z8KwOztjxHY5AsWP0JhFNNnyW96d6Akhl8hVmdy7S3TEN4PwmBqa O9zEl3A3g1ZlxXf7GJx3sm7tbL5OU8ZYpkpHFiF3g+ouBHwzSiyZ5xZZ7BmYf5RLPPp53dAnip6qq JjflshUaQgk2g6+PwaCqFARm7SnNmrIxzFKyq2iThIHEIEWwU24xpdBX0LU4HPgiZPO2WNb6XV1L+ vGiNKWqhDQR0UoedHgS40VeHdnNT4+IaJDv1k4Ll9x6pkrEoJlNB1YmESgdLMArWr50Od1Takz7U0 MQymZSJ96v/0sQ==; Received: from [193.50.110.253] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pacgl-0007ZE-A0; Fri, 10 Mar 2023 08:21:41 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal Subject: Re: [PATCH v3 1/8] services: network-manager: Add 'shepherd-requirement' field. References: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 20 =?utf-8?Q?Vent=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Cordeau 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: Fri, 10 Mar 2023 14:21:37 +0100 In-Reply-To: <6d50c6d0cf8bc441bd9f38a0e2c02613b0a90d19.1678193024.git.mirai@makinata.eu> (Bruno Victal's message of "Tue, 7 Mar 2023 12:43:58 +0000") Message-ID: <87edpw91y6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: 61587-done Cc: 61587-done@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: -3.3 (---) Hi Bruno, Applied v3, thank you! Ludo=E2=80=99. From unknown Mon Jun 23 04:13:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 08 Apr 2023 11:24:10 +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