From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WAqSOLANNWSaNgAASxT56A (envelope-from ) for ; Tue, 11 Apr 2023 09:35:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id UHeNN7ANNWSg4wAAG6o9tA (envelope-from ) for ; Tue, 11 Apr 2023 09:35:12 +0200 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 2728D8EC9 for ; Tue, 11 Apr 2023 09:35:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pm8Wv-00028P-Qw; Tue, 11 Apr 2023 03:35:05 -0400 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 1pm8Ws-00027W-Nx for guix-patches@gnu.org; Tue, 11 Apr 2023 03:35:03 -0400 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 1pm8Ws-0005Bg-9W for guix-patches@gnu.org; Tue, 11 Apr 2023 03:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pm8Wr-0000RJ-Qz for guix-patches@gnu.org; Tue, 11 Apr 2023 03:35:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62770] [PATCH] services: dhcp-client-configuration: Add 'shepherd-requirement' field. Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 11 Apr 2023 07:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62770 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62770@debbugs.gnu.org Cc: Sergey Trofimov X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16811984591637 (code B ref -1); Tue, 11 Apr 2023 07:35:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Apr 2023 07:34:19 +0000 Received: from localhost ([127.0.0.1]:36520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pm8WB-0000QK-BC for submit@debbugs.gnu.org; Tue, 11 Apr 2023 03:34:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:59882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pm8W8-0000QC-VL for submit@debbugs.gnu.org; Tue, 11 Apr 2023 03:34:17 -0400 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 1pm8W8-00022R-JD for guix-patches@gnu.org; Tue, 11 Apr 2023 03:34:16 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pm8W5-00057l-R1 for guix-patches@gnu.org; Tue, 11 Apr 2023 03:34:15 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-50489acccdfso1726639a12.1 for ; Tue, 11 Apr 2023 00:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1681198450; x=1683790450; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PQQ+Qpk7Izjc93OjfK96zBqMMHAmjHi5a3USV97opUU=; b=SDj6eLW755Klselvx+YfOkQCMOryB9YzFFugdGYsUjHuiGnAQNlSCAGT4A2d2ftzoi nXAoMnK0GXnZMPmDgXnaVA3h3B9jWdlQ8dPekb8JzrNAwNT1H4H/Qj2I7ejodDFAtIxe fZJa4rkfnfgucZ1ctT24b4syBqAAP83Sp7oZ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681198450; x=1683790450; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PQQ+Qpk7Izjc93OjfK96zBqMMHAmjHi5a3USV97opUU=; b=x90nPWuk7zylkb1k25oM2qWVdZ+a65jos16W1kW23lqvpymXcs3TgGeC3wIfc2mIrM ZLTVc6oyaWy4q64wbeO9iFaj2QQkIxEPCW55MujwAyPJlsWnXqWo3xuN/FM1ZGtT9QS9 kzhGwPgnO3hbJE1zd35jqY2Lwvo8L3Ary7BMbZKEFZmMokbEtAL+sWvsKbdLxO85Nb0L d2cqdBLlrq6xtxdV0IX7ZWiUtkmwMlh+vhATDagATcpmiHlN/coytIqdKQdcvg6PdmGA ygyBF9MUJ5AA+nyxhksElXJ0nt4Cx1GkmMpdoB07IDPv0i3QtIMyeSPUt/p4H9b5QIYu 9H9Q== X-Gm-Message-State: AAQBX9eHppFeGVvlKqYryo7EeE4ztz33WF3xOcb7qMKIXVho1U/fCN6E jQvgjX9yWiOIT76Mj5mMePOErdEDW9fo0/UB87Tdng== X-Google-Smtp-Source: AKy350Y/iF/x0zcaSPo7Oa0CJBRPQJ6nhqpBWDspGpd4YJS+Dlbswag3scDuYfA4r6VmwWJZFSjVwg== X-Received: by 2002:a05:6402:643:b0:4fb:98e2:3df8 with SMTP id u3-20020a056402064300b004fb98e23df8mr11905108edx.27.1681198449670; Tue, 11 Apr 2023 00:34:09 -0700 (PDT) Received: from localhost ([95.168.154.15]) by smtp.gmail.com with ESMTPSA id f6-20020a50d546000000b00501d39f1d2dsm5609191edj.41.2023.04.11.00.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 00:34:09 -0700 (PDT) From: Sergey Trofimov Date: Tue, 11 Apr 2023 09:33:57 +0200 Message-Id: <20230411073357.30021-1-sarg@sarg.org.ru> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=2a00:1450:4864:20::52b; envelope-from=sarg@sarg.org.ru; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-Seal: i=1; s=key1; d=yhetil.org; t=1681198512; a=rsa-sha256; cv=none; b=fr4918uBPm3G0fPpOGdendh6/LrfVmE8SaaMHX1iuW8PoEqdnOlL7+XRc2jaNvH+eY3tZg C2z3B1Smnq6piwjHvEVY39Go560vg3gnh26iB01xNP5Cl+yTNj13I5W9ScnLDrrl/ZhC81 KPbPZtRcwqLSv/cj1hNYAJWLVCuDAomzmyQMMeUHT2wR81myJAmJLAeXPT0TgQKKrcM0DD /+T3aYD+oYkMOQ4j4JhkYlNJgirHTkJQaRFMrNcHFE5+Qii/GhnmUiAx5eYELbGy3Z7N3U xMlRN+EyTCgtV5XE7LzOEmoq/pGXuyy9j9iEK0XbtHzqoJpYkUxSha+BQ2Ci2Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=sarg.org.ru header.s=google header.b=SDj6eLW7; dmarc=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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681198512; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=PQQ+Qpk7Izjc93OjfK96zBqMMHAmjHi5a3USV97opUU=; b=OMDmmXJ7aLy6qBgv82JJtGiYoKskgKkznIIJEVJ0Q+PZ5PsvABm/u5+mzk5L7NfLN0vnpB XpvotbvLsvXmukjGKOTU8H8AUeKQnZV85WvfLPnVcSJ6AknZVD/bgjS0H4BlD35R0jQtCx vh7HlgxaRsXNOEINnY0kboVISODF8pBlkVSJ/nfKNq6eFxrmSPGcgFQScKmN0uWkNGKcMx FAZTHMoX4ukG9M5fIirs2B2wjsbteKSkW5kc0iJmLqR5J2Uz71j4GAAz79myVF+65sNpmf 9w9biOvkZHY+iOyzSK1YKranjPShQVPY9AepiiMHgwhUDT/c/+331rK+c+oXlw== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=sarg.org.ru header.s=google header.b=SDj6eLW7; dmarc=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" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -1.72 X-Spam-Score: -1.72 X-Migadu-Queue-Id: 2728D8EC9 X-TUID: QHnEhfcY5IgV * gnu/services/networking.scm () [shepherd-requirement]: New field. (dhcp-client-shepherd-service): Honor it. (dhcp-client-configuration-shepherd-requirement): Export accessor. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 8 +++++++- gnu/services/networking.scm | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ac60acf98c..25f06fd0a8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19892,6 +19892,12 @@ should listen on---e.g., @code{'("eno1")}. When set to @code{'all}, the DHCP client listens on all the available non-loopback interfaces that can be activated. Otherwise the DHCP client listens only on the specified interfaces. + +@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. @end table @end deftp @@ -19995,7 +20001,7 @@ Data Type representing the configuration of connman. @item @code{connman} (default: @var{connman}) The connman package to use. -@item @code{shepherd-requirement} (default: @code{()}) +@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 diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 19c109d238..1b2e6a8c53 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -89,6 +89,7 @@ (define-module (gnu services networking) dhcp-client-configuration? dhcp-client-configuration-package dhcp-client-configuration-interfaces + dhcp-client-configuration-shepherd-requirement dhcpd-service-type dhcpd-configuration @@ -279,6 +280,8 @@ (define-record-type* dhcp-client-configuration? (package dhcp-client-configuration-package ;file-like (default isc-dhcp)) + (shepherd-requirement dhcp-client-configuration-shepherd-requirement + (default '())) (interfaces dhcp-client-configuration-interfaces (default 'all))) ;'all | list of strings @@ -286,11 +289,12 @@ (define dhcp-client-shepherd-service (match-lambda ((? dhcp-client-configuration? config) (let ((package (dhcp-client-configuration-package config)) + (shepherd-requirement (dhcp-client-configuration-shepherd-requirement config)) (interfaces (dhcp-client-configuration-interfaces config)) (pid-file "/var/run/dhclient.pid")) (list (shepherd-service (documentation "Set up networking via DHCP.") - (requirement '(user-processes udev)) + (requirement `(user-processes udev ,@shepherd-requirement)) ;; XXX: Running with '-nw' ("no wait") avoids blocking for a minute when ;; networking is unavailable, but also means that the interface is not up -- 2.39.2