From patchwork Fri Mar 3 22:59:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47585 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F093016D3A; Fri, 3 Mar 2023 23:00:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 487AC16D05 for ; Fri, 3 Mar 2023 23:00:42 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYENi-0000tv-F1; Fri, 03 Mar 2023 18:00:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYENg-0000rJ-Ap for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYENf-0007JU-8W for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYENf-0000xr-4l for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v2 1/8] services: network-manager: Add 'shepherd-requirement' field. References: In-Reply-To: Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Mar 2023 23:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16778843923597 (code B ref 61587); Fri, 03 Mar 2023 23:00:03 +0000 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 Date: Fri, 3 Mar 2023 22:59:06 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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(-) base-commit: 6a1464b0cc8c0b3e53d2580661a8c69d79f183ab 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") From patchwork Fri Mar 3 22:59:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47590 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3D73916D3A; Fri, 3 Mar 2023 23:01:02 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6A26B16D05 for ; Fri, 3 Mar 2023 23:01:01 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYENl-0000vK-08; Fri, 03 Mar 2023 18:00:09 -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 1pYENi-0000ty-GJ for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYENi-0007Vf-6Q for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYENi-0000yg-2X for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v2 2/8] services: network-manager: Deprecate 'iwd?' field. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Mar 2023 23:00:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16778843993659 (code B ref 61587); Fri, 03 Mar 2023 23:00:06 +0000 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 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 From patchwork Fri Mar 3 22:59:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47589 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 068A416D3A; Fri, 3 Mar 2023 23:01:01 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8258316D05 for ; Fri, 3 Mar 2023 23:01:00 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYENl-0000vX-KG; Fri, 03 Mar 2023 18:00:09 -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 1pYENj-0000uW-JM for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYENi-0007Xv-W8 for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYENi-0000yw-SI for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v2 3/8] services: connman: Use match-record and export accessors. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Mar 2023 23:00:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16778844053744 (code B ref 61587); Fri, 03 Mar 2023 23:00:06 +0000 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 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 From patchwork Fri Mar 3 22:59:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47584 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1138816D34; Fri, 3 Mar 2023 23:00:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0BCB116D05 for ; Fri, 3 Mar 2023 23:00:40 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYENk-0000vF-Gl; Fri, 03 Mar 2023 18:00:08 -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 1pYENh-0000sc-Ov for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYENh-0007Tq-CM for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYENh-0000yR-8P for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v2 4/8] services: connman: Add 'shepherd-requirement' field. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Mar 2023 23:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16778843943618 (code B ref 61587); Fri, 03 Mar 2023 23:00:05 +0000 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 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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") From patchwork Fri Mar 3 22:59:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47586 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 04F8216D3A; Fri, 3 Mar 2023 23:00:55 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 184F016D05 for ; Fri, 3 Mar 2023 23:00:54 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYENj-0000uX-LX; Fri, 03 Mar 2023 18:00:07 -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 1pYENh-0000ri-H0 for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYENg-0007TI-Mj for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYENg-0000yE-HI for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v2 5/8] services: connman: Deprecate 'iwd?' field. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Mar 2023 23:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16778843933612 (code B ref 61587); Fri, 03 Mar 2023 23:00:04 +0000 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 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 From patchwork Fri Mar 3 22:59:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47588 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 81E4416D47; Fri, 3 Mar 2023 23:00:58 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9FA4D16D34 for ; Fri, 3 Mar 2023 23:00:57 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYENl-0000vO-BG; Fri, 03 Mar 2023 18:00:09 -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 1pYENi-0000tt-9I for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYENh-0007UH-VO for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYENh-0000yZ-Lg for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v2 6/8] services: network-manager: Await for NetworkManager to finish starting up. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Mar 2023 23:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16778843983648 (code B ref 61587); Fri, 03 Mar 2023 23:00:05 +0000 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 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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 From patchwork Fri Mar 3 22:59:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47587 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B5A0916D05; Fri, 3 Mar 2023 23:00:57 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2D82416D05 for ; Fri, 3 Mar 2023 23:00:57 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYENl-0000vL-5K; Fri, 03 Mar 2023 18:00:09 -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 1pYENj-0000uV-JI for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYENi-0007Wm-Ll for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYENi-0000yo-FS for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v2 7/8] services: network-manager: Set service canonical-name to NetworkManager. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Mar 2023 23:00:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16778843993666 (code B ref 61587); Fri, 03 Mar 2023 23:00:06 +0000 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 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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 From patchwork Fri Mar 3 22:59:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47583 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id EDF0C16D3A; Fri, 3 Mar 2023 23:00:36 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 74A8716D05 for ; Fri, 3 Mar 2023 23:00:36 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYENh-0000sM-QP; Fri, 03 Mar 2023 18:00:05 -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 1pYENg-0000rI-9r for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYENf-0007OW-Rf for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYENf-0000y3-MP for guix-patches@gnu.org; Fri, 03 Mar 2023 18:00:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v2 8/8] services: connman: Set service canonical-name to connman. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Mar 2023 23:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16778843933604 (code B ref 61587); Fri, 03 Mar 2023 23:00:03 +0000 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 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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