From patchwork Tue Mar 18 21:00:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 40354 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 4A6F627BBE9; Tue, 18 Mar 2025 21:01:20 +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 021F027BBE2 for ; Tue, 18 Mar 2025 21:01:18 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tue3e-0002aJ-AY; Tue, 18 Mar 2025 17:01:06 -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 1tue3b-0002Zv-Ua for guix-patches@gnu.org; Tue, 18 Mar 2025 17:01:03 -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 1tue3a-00072u-SH; Tue, 18 Mar 2025 17:01:02 -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:In-Reply-To:References:Subject; bh=n+KdtPkWs5QGUUpSjKwPw1F+QOu94O/64Vne4HuyHCg=; b=Fbg4BPrxSH1hnemcvH4WGa8fYZsqb6ti9g0pZ2eTgONHfgymWR+B1Lf9VKWQ2zOz82wO8qKH1PCE5WIjrPEdYmiKuXSaJ7EGVo1il7Zs1nBzpPXqfysc74zd1MYIYFCXUOsV4gn8LItpxI62TRpcuHnPRO1DhKMzmxEVWUU0SNx/lGr7YbSfnOUGYJJEzX3Av0d9zJx/YY7uuOpj+9mM7N0Rjk6T2c+G9ardXFVR/OuyDQ8/4PR+ov//Zvp6AyWXD4M/9VQXgtc+PDVJfb90busqnN+k8dvo177pkST2nCFbIrEoksow48emt8ALSEaYHGYaKtUDlg8n3fzJhnpfoQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tue3a-0003xA-Kh; Tue, 18 Mar 2025 17:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77045] [PATCH v1] services: wireguard: Add the shepherd-requirement field. References: <92993d415b51bd7e4b0828b3fd87163f8b7a4219.1742111625.git.sarg@sarg.org.ru> In-Reply-To: <92993d415b51bd7e4b0828b3fd87163f8b7a4219.1742111625.git.sarg@sarg.org.ru> Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: sarg@sarg.org.ru, ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 18 Mar 2025 21:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77045 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77045@debbugs.gnu.org Cc: Sergey Trofimov , Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Sergey Trofimov , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 77045-submit@debbugs.gnu.org id=B77045.174233164715054 (code B ref 77045); Tue, 18 Mar 2025 21:01:02 +0000 Received: (at 77045) by debbugs.gnu.org; 18 Mar 2025 21:00:47 +0000 Received: from localhost ([127.0.0.1]:43540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tue3G-0003tv-14 for submit@debbugs.gnu.org; Tue, 18 Mar 2025 17:00:46 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:51543) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tue3D-0003t4-Em for 77045@debbugs.gnu.org; Tue, 18 Mar 2025 17:00:40 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-abbd96bef64so1070396466b.3 for <77045@debbugs.gnu.org>; Tue, 18 Mar 2025 14:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1742331632; x=1742936432; darn=debbugs.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=n+KdtPkWs5QGUUpSjKwPw1F+QOu94O/64Vne4HuyHCg=; b=Y22i5Uw039b/vAgxNljYMCgRPd7ESFj+wfovyzG3dGJRd+ky5++TRnpsnGJip4niv5 ZJKRHnlktkXoQq8fPoP+kPEjFH3eIQXNDc3iAhIFVx4bN7v9ksSAlUW4RFTN1fAopNRP b09JvpABuXBfy7Ot1sNn+dBene0ZXNVc2ZGjW7q4K2hu2jBhKbZxjADLcwZz6AhV+MpG TjX95W231ZxHvQL4eTOrOaEv7NVgxoPngRoXOCTCtnDudeld3qf7HIK6O0Iey5K5UOqG 28GTcEb0dNzWXr4Zfifh955/Jut9UJPQUyEONBbW2Nr2cmBbZl9bcSpdEq1O1fhJGOwZ P7xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742331632; x=1742936432; 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=n+KdtPkWs5QGUUpSjKwPw1F+QOu94O/64Vne4HuyHCg=; b=NX1TklOaKpOqrDrvXRfU71ed4XEUx96s5oHRpF6vVGewa4BLEHzsct7pF98y+d0TPs j0xCHtcB0m4OQ0i8lVQgJ09/ahLZOUNj3Lm/RZQDU97DFOkpKAGALnIfbAxOtThdcidL ASeqzXAly8Gvl0XB7D+Ek9gz2sLhVU5Vlp3YifwOHGQ8NlWWvTBB5JSIb4q6dZQGy1wz +zEUq+7FN4QR5Omel00caKRq9Pn4d2i8/dCmwgyuL2CkpIr4PlG3DW26YVa3+FTQlx50 RbI+t+rSyKXDK9hTYC4VAQqOydL+VJchkzmBedWshxIBJh1XFR+qfz14I0VA3YSX2xZ6 SEDw== X-Gm-Message-State: AOJu0Ywk6ZLleCSqhNmlDVVhHbZRJlGTU0psEsrh9fr1hUrJr6DK8GVz By4ha01SMA6f0DFjYgciUjDfnMKCCXEjJiHzQ3+eT2s2hckHLJkJE4eq4yLdhTUowG6453ecys4 s+xM= X-Gm-Gg: ASbGncuz5y7N5Y77Rot1f4Pqwx3AxAdYko5aCjU0LDDtUPOFpfBM/N9qc9XvsXIpmB2 wcY5P30GqzQSCDARDkoS1owg8JtRTI1vBmv1keLS1smNf1iyh9gvCNzvrRVKzYCxS+2+CURBzJO GAE/v1FCVzNvH9hIHzI83vyPitlP5AcTM6U1Gjd4JMAFSN8MInOYj/BTntW1ej+yphZooH+O09X OMgHKYACrn8M8GkJV+/U7dKXZCEdW95Sw2yMlD7PldBun4feJnfB+0UUkzEv2J2zXsEYgmsQuzC DErsZ0vGkd0TyYvf2BwGb7TCWymMofDo6P7vJ1Cz/Sg= X-Google-Smtp-Source: AGHT+IHZKRw3vJ+kMN9xnc+hoxgmEKbdmyUnfa8e+yYuCmckmSRYKlrS4FtDWnEzo7GMpfc+sO5fgA== X-Received: by 2002:a17:906:6a0a:b0:ac2:a4ec:46c2 with SMTP id a640c23a62f3a-ac3b7fb201fmr8497066b.49.1742331632293; Tue, 18 Mar 2025 14:00:32 -0700 (PDT) Received: from localhost ([2a02:2454:a0a5:2400:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3149cec1esm899614766b.114.2025.03.18.14.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Mar 2025 14:00:31 -0700 (PDT) Date: Tue, 18 Mar 2025 22:00:14 +0100 Message-ID: X-Mailer: git-send-email 2.48.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: , 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. Add user-processes to requirements. * doc/guix.texi (VPN Services):[wireguard]: Document it. Change-Id: Ia85add5067f6f9e023b8d65d6ce067b98eeb111e --- doc/guix.texi | 4 ++++ gnu/services/vpn.scm | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) base-commit: df799a61ef73451e587cb81942c7bfcbbade9e7e prerequisite-patch-id: f9cc903b8048c8c6fde576fbf38ab110263020e3 prerequisite-patch-id: 220ddf11addf3a6c7ab3b349077bca6849241556 prerequisite-patch-id: fc7d254c8dc198bc2f083e1c8aea18960c73b165 diff --git a/doc/guix.texi b/doc/guix.texi index 794afcd8c4..9352c56563 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35739,6 +35739,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..3f1f8661d8 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 user-processes ,@shepherd-requirement)) (provision (list (wireguard-service-name interface))) (start #~(lambda _ (invoke #$wg-quick "up" #$config)))