From patchwork Sun Mar 16 07:55:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 40255 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 2F60B27BBE9; Sun, 16 Mar 2025 07:57:22 +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=-6.3 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED,URIBL_SBL_A 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 C786227BBE2 for ; Sun, 16 Mar 2025 07:57:20 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttirq-0006wC-4A; Sun, 16 Mar 2025 03:57:07 -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 1ttiro-0006vx-D3 for guix-patches@gnu.org; Sun, 16 Mar 2025 03:57:04 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ttirn-00071U-7v; Sun, 16 Mar 2025 03:57:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=mv575txBlWXuSca5X6KJXez11Xj5b51JOKzKu5KJe3M=; b=sGsxwFis4FU3gEb8x4dNMmGwETUXgQGx3MY1fR2Iou8hQE6h9hR2MLfsyLjCkMkurJp2GfXIVF9swr1K6Mgl+Mvp+qNfEHyKVjAx6MumOFmWm9fDG/MefAg5JlolkiY4yxz/KwYs7ELR/TSkgh4VXjQq/Op5NHui707HD19eCrTncqDF1AVeZ7eT2ly0lk/jv3/V5cqE1hX7tzoH7nxSIKVeV6x0ZStqHHUyDs2PeOPjmskp+kHMQQzKXSvs+vDF1vPfhqIrJjnf1OMec+2l+ZD1j7C3WWvkPYUNzL0ugpmbXmTL47sT7ume6SKUncRq5ebPFdZeukc7XLsV7KPGXA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttirn-0003BP-1j; Sun, 16 Mar 2025 03:57:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77045] [PATCH] services: wireguard: Add the shepherd-requirement field. Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sun, 16 Mar 2025 07:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77045 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77045@debbugs.gnu.org Cc: Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by submit@debbugs.gnu.org id=B.174211176211825 (code B ref -1); Sun, 16 Mar 2025 07:57:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Mar 2025 07:56:02 +0000 Received: from localhost ([127.0.0.1]:45224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttiqn-00034V-MF for submit@debbugs.gnu.org; Sun, 16 Mar 2025 03:56:02 -0400 Received: from lists.gnu.org ([2001:470:142::17]:35674) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttiqk-000334-9m for submit@debbugs.gnu.org; Sun, 16 Mar 2025 03:56:00 -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 1ttiqa-0006ck-8P for guix-patches@gnu.org; Sun, 16 Mar 2025 03:55:49 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ttiqY-0006w6-Ab for guix-patches@gnu.org; Sun, 16 Mar 2025 03:55:48 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-ac2ab99e16eso118176666b.0 for ; Sun, 16 Mar 2025 00:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1742111742; x=1742716542; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mv575txBlWXuSca5X6KJXez11Xj5b51JOKzKu5KJe3M=; b=ujzfwvs5iS786mXbm9AGDtuDs9KTt1Pr/ifmYVVge26z1OxTR0YiZaBWjcgfww+4HW RkswT1F11pST69CLW0QYDhWr8jjwWxCDDOYDRJCEppJVnt/75aq3WTh+DUTUS6iFXgMd ucC0KUm5BZeyJ8dCkCGusZF/8LjOKawhurPRMFFLHpB9goJ0rUbaTDB80yfG1qJU/0XD 9u7ID6W5ZRw6re+akqzJH9z4EbaBqnovHPisL3C4CkJ7mH0cqe64pywiXgdRAx3T+Yfp GfKhfPul+lO8V9p5+evMerFe7pRJdZQpQvq80DInBehOTlYKXLbiNjgefJilKK00wlil k/Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742111742; x=1742716542; 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=mv575txBlWXuSca5X6KJXez11Xj5b51JOKzKu5KJe3M=; b=GkEmjWZgWea2VXOsXwDs8qszqIMjqZHWprOr4hgxmT9bjjoNG0QyiYLB6vn6vcubN/ yElqc/inwDdns09Lky6Ve88HXbvTNFfhSusPdZMkptI9X5bc+67QSj1iB0ZjV5eOa9gb Xt1J9ZBV1mm7E4NsxO6Q93IUscrURJkqmSqY0mWxxM4LqouhE4IsBVnCBMwyD9A3p0af QnlhhFT9iUKgs2ZRQkzpVO8HLw+yLD3C6Dd+hmXtSHN+nCErpLpGD+iNnjlZJ8KZoGHn GkxBzKe/ULkUx8jXg560oDrWvw6wJ8WlSnJjrYcbyFp2zUOAaeDosWp0afeym0cbKabg kGiQ== X-Gm-Message-State: AOJu0YwRrDHJOjaazmPHEQEHwhHBhEl8v4oz92UMtVxRXWxPX5RXFRQE h922JDWUQwHIiXhIqxPNY16YSc8xPzDzshz+c7u9lBPTDQ/gs9xgsQOMpfSC8RKmzR1PaOsSwTf 1Yw4= X-Gm-Gg: ASbGncvKxOJR3x06cxo5mQ/QzWqO599MmiXyKuzSl9cQ84XpI1PFWuUCgCqmicXDwtQ 3tv8uZh08fXjYFTMxygVz1ycBf/xCx7rgXATZjGvztgzOnO24kkIarKIFb/a72LH11KLf0bDYHE Vq+lQ6IswyTPoLcml1svSgSzn9+TG3XhUFOzvgoJXluEqk1yZkQmY4K8ir9sQUjbYlnE0JuOkN3 qWfKwVutUMSrnpLOY8UylfTNLS5VRZW9NhG8bqDnZ3wtQRTmTtkOZgUlfwojtvKugqRPaPCGitu bWVCjwgVugcJscJbK0nhlL1wLnup0Qc8ELBDr5mz+sN589EX93Yb X-Google-Smtp-Source: AGHT+IFAm6wc6Ok640VjWh9e/Khm0SK0EGarD8LHsxyBUpzkGExDLWaXDWfMpuvnVFY5eb4UN1QdmQ== X-Received: by 2002:a17:907:da5:b0:ac2:6bb5:413c with SMTP id a640c23a62f3a-ac330317c9cmr1001150766b.31.1742111741835; Sun, 16 Mar 2025 00:55:41 -0700 (PDT) Received: from localhost ([2a02:2454:a0a5:2400:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac32c6de6ecsm366657566b.173.2025.03.16.00.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Mar 2025 00:55:40 -0700 (PDT) Date: Sun, 16 Mar 2025 08:55:37 +0100 Message-ID: <92993d415b51bd7e4b0828b3fd87163f8b7a4219.1742111625.git.sarg@sarg.org.ru> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=sarg@sarg.org.ru; helo=mail-ej1-x633.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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_PASS=-0.001, URIBL_SBL_A=0.1 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: , Reply-to: Sergey Trofimov X-ACL-Warn: , Sergey Trofimov via Guix-patches X-Patchwork-Original-From: Sergey Trofimov via Guix-patches via From: Sergey Trofimov 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/vpn.scm (): Add shepherd-requirement. (wireguard-shepherd-service): Pass shepherd-requirement. * doc/guix.texi (VPN Services):[wireguard]: Document it. --- doc/guix.texi | 4 ++++ gnu/services/vpn.scm | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) base-commit: b8024fa1ade69a4f97990f0e3379eef01dfd40c2 prerequisite-patch-id: f9cc903b8048c8c6fde576fbf38ab110263020e3 prerequisite-patch-id: 54f1264dad23a74efa9aa3823350b2ee055bda97 prerequisite-patch-id: 220ddf11addf3a6c7ab3b349077bca6849241556 prerequisite-patch-id: 18f3d7d0a9ed1f267adeb3630b3801a0c179d9ea diff --git a/doc/guix.texi b/doc/guix.texi index 883cdc2803..681200e5f9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35711,6 +35711,10 @@ VPN Services List of strings or G-expressions. These are script snippets which will be executed after tearing down the interface. +@item @code{shepherd-requirement} (default: @code{'()}) (type: list-of-symbols) +A list of symbols naming Shepherd services that this service +will depend on. + @item @code{table} (default: @code{"auto"}) The routing table to which routes are added, as a string. There are two special values: @code{"off"} that disables the creation of routes diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 478a0d543e..2b5886c9fa 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -88,6 +88,7 @@ (define-module (gnu services vpn) wireguard-configuration-post-up wireguard-configuration-pre-down wireguard-configuration-post-down + wireguard-configuration-shepherd-requirement wireguard-configuration-table wireguard-configuration-auto-start? @@ -765,6 +766,8 @@ (define-record-type* (default '())) (post-down wireguard-configuration-post-down ;list of strings (default '())) + (shepherd-requirement wireguard-configuration-shepherd-requirement ; list of symbols + (default '())) (table wireguard-configuration-table ;string (default "auto")) (auto-start? wireguard-configuration-auto-start? ;boolean @@ -918,12 +921,12 @@ (define (endpoint-host-names peers) (define (wireguard-shepherd-service config) (match-record config - (wireguard interface) + (wireguard interface shepherd-requirement) (let ((wg-quick (file-append wireguard "/bin/wg-quick")) (auto-start? (wireguard-configuration-auto-start? config)) (config (wireguard-configuration-file config))) (list (shepherd-service - (requirement '(networking)) + (requirement `(networking ,@shepherd-requirement)) (provision (list (wireguard-service-name interface))) (start #~(lambda _ (invoke #$wg-quick "up" #$config)))