From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id QN42CgoyB2QlcwAASxT56A (envelope-from ) for ; Tue, 07 Mar 2023 13:46:02 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cJ9aCQoyB2R5ugAAG6o9tA (envelope-from ) for ; Tue, 07 Mar 2023 13:46:02 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E170AC670 for ; Tue, 7 Mar 2023 13:46:01 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZWgn-0001c7-Id; Tue, 07 Mar 2023 07:45: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 1pZWgh-0001Km-TC for guix-patches@gnu.org; Tue, 07 Mar 2023 07:45:03 -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 1pZWgh-0003HT-Fd for guix-patches@gnu.org; Tue, 07 Mar 2023 07:45:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZWgh-0002Ba-A1 for guix-patches@gnu.org; Tue, 07 Mar 2023 07:45:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH v3 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: Tue, 07 Mar 2023 12:45: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: ludo@gnu.org, Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.16781930678288 (code B ref 61587); Tue, 07 Mar 2023 12:45:03 +0000 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 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-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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678193161; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=cNkL8llqsnCyRO97/qWh/rjGi8ikJv09sbslfb1sVyM=; b=sAC90Kc2hMrFDpzTc679PA+tGQ7/2ZsITQ9Yycq/2gaw5TaQ8EHS4+1k9t0hUW3+klcpSh uqK8HKm+LAzwymP/eVDsM68zQZwqkKIL9zB/SYHmhr/oRb0exQwMe/eKWh1b/uFmJWTu6z BcUkwRij8q/t923F2JvXOE8sBlnregAj759ABcBMIVIaAcRSpWBmyiMkBXD8OybmsKJtcp EpJhifjOjp99vrZaW/uRo1CytB5Ji9/m9uWeroOoDavRqMEr46naJiqllzzWHRE1hOfeQY xsWOnPx4GjDDDSFYcNRIxYrD/0oNIdKtb9oELqnbwRXrujjUDQMfuvBxPl7M5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678193161; a=rsa-sha256; cv=none; b=fK1zKIAoUgOrYKwXR707NtOZbu4GsBS8Tu7mYUp7e09Kq6RC4NL5EUZuARuyd4TQ+XUjLK 8UGyZ3pk3VWkGqyuzcxtoK9NC29j9EmVVfSaGPUA8mb7UlkIhKdFb6KTdcyJ0rjJQUjozZ t/8LVo1ZU/M7BChGdI5LxRwtbWfxOF+bX2+M7OYJagTnto85WYEPaU6ym0/JHcSje5LhC3 f5pUougxqImR8awbSHqyGHS6KEhczfTaU48W4mbSIFLJNv496B+8cPpwpQ6mbEqxu8ZKb1 sn6kuF46nriVlN/oM7ALgY0OV2u9IS/PRL0l2k57XhOgEypx+pD3ValoY11e+Q== Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Spam-Score: -0.21 X-Spam-Score: -0.21 X-Migadu-Queue-Id: E170AC670 X-Migadu-Scanner: scn1.migadu.com X-TUID: tokDIMaRGacN * 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