From patchwork Fri Jan 17 22:19:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37124 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 A82ED27BBEA; Fri, 17 Jan 2025 22:21:43 +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=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, 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 18C0C27BBE2 for ; Fri, 17 Jan 2025 22:21:43 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYuiE-0006Gi-Gm; Fri, 17 Jan 2025 17:21:10 -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 1tYuiC-0006Fj-Fw for guix-patches@gnu.org; Fri, 17 Jan 2025 17:21:08 -0500 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 1tYuiC-0002hT-74; Fri, 17 Jan 2025 17:21:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=hauk8xGQY6hjAZ9vhh9Qk3SigJI9htiY0MI/z856ATU=; b=vwn1YMQFC9kvoGjYp/PD1SMl+03KsClzcPKzxGdVEWl4Bpa0Ph+HFK/PQ/TO+lqFezz/ledcaHRNr/RCAvuChSjP62nnEJVoVhyvTnyb/HC/Rm0nyWvzbTSvivUc3f59NWK9p7//t7ml+Ws8osaOurx/2iEWeVmqXGArtGU0E2Q84T2UEZIPdDKM1HNc4GhUnbHKOlXqEuw64iONJTNifTgrMbfb6ykTGu28VNe8JH6S4717Pe92pRKipJAk0BMGnVQtk9ZF8BU07Z7oU5MdusFgCXm388VpZPREv3hG1KHKfb5EUNadyi7YRS4PQsr6MOZheD+1EQYqcTITOKOjTQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tYui5-0002YG-LB; Fri, 17 Jan 2025 17:21:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74997] [PATCH 1/4] services: shepherd: Add =?utf-8?b?4oCYdHJh?= =?utf-8?b?bnNpZW504oCZ?= and =?utf-8?b?4oCYdGltZXLigJku?= Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: herman@rimm.ee, ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 17 Jan 2025 22:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74997 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74997@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Herman Rimm , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Herman Rimm , Ludovic =?utf-8?q?Cour?= =?utf-8?q?t=C3=A8s?= , Maxim Cournoyer Received: via spool by 74997-submit@debbugs.gnu.org id=B74997.17371524069348 (code B ref 74997); Fri, 17 Jan 2025 22:21:01 +0000 Received: (at 74997) by debbugs.gnu.org; 17 Jan 2025 22:20:06 +0000 Received: from localhost ([127.0.0.1]:39125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tYuhA-0002QE-CL for submit@debbugs.gnu.org; Fri, 17 Jan 2025 17:20:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35810) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tYuh6-0002P0-Ih for 74997@debbugs.gnu.org; Fri, 17 Jan 2025 17:20:02 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYuh1-0002L6-A0; Fri, 17 Jan 2025 17:19:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=hauk8xGQY6hjAZ9vhh9Qk3SigJI9htiY0MI/z856ATU=; b=bBCGOGjgJz9h74kZgoLd WtXuvAoYQjWS6ZRWgXoo9HZt7Xyfa5Y3xo3Bm5oiY0c6fqqKLiEqciFH8hewf1eMlKMxsmCpOeXP0 lMgXT6mtr3Ocs9pSutD0iOiBxmCnx5/OvU6yLMYKU9N+aRq++zmSJQWYQqzZ+wt6reTPuWvpIbEh7 3atANJoloa4XYThTYE4OYfL+c0GswBu41Ih1MCpOl71NDlu6Pr/Q1hrKB+MVi31CzOPulYJjaEHE8 zEuSgriAfjxTN2aOPn6zxrkI91U8zf11bnE/Os53rlC1vIt45opH6JpEjDq9HQ/FkafgUXv0TxU04 imDPTfYeH65lPw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 17 Jan 2025 23:19:20 +0100 Message-ID: X-Mailer: git-send-email 2.47.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/shepherd.scm (shepherd-timer-service-type) (shepherd-transient-service-type): New variables. * doc/guix.texi (Shepherd Services): Document them. Change-Id: I9b622e7e947e7a6384c2701a313d0c7080a0a5f6 Reviewed-by: Maxim Cournoyer --- doc/guix.texi | 33 ++++++++++++++++++++++++ gnu/services/shepherd.scm | 54 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 85 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0015d739bb..3e377ca9f4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -45684,6 +45684,39 @@ Shepherd Services (shepherd my-shepherd)))))) @end lisp +@cindex @code{transient} service, Shepherd +@defvar shepherd-transient-service-type +This service type represents the Shepherd's @code{transient} service, +which lets you spawn commands in the background and interact with them +as regular Shepherd service; it is similar to @command{systemd-run}. + +For example, the command below spawns @command{rsync} in the background, +in an environment where the @env{SSH_AUTH_SOCK} environment variable has +the given value: + +@example +herd spawn transient -E SSH_AUTH_SOCK=$SSH_AUTH_SOCK -- \ + rsync -e ssh -vur . backup.example.org: +@end example + +@xref{Transient Service Maker,,, shepherd, The GNU Shepherd Manual}, for +more info on the @code{transient} service. +@end defvar + +@cindex @code{timer} service, Shepherd +@defvar shepherd-timer-service-type +This is the service type representing the Shepherd's @code{timer} +service, which lets you schedule the execution of commands, similar to +the venerable @command{at} command. Here is an example: + +@example +herd schedule timer at 07:00 -- mpg123 Music/alarm.mp3 +@end example + +@xref{Timer Service,,, shepherd, The GNU Shepherd Manual}, for more info +on the @code{timer} service. +@end defvar + @defvar %shepherd-root-service This service represents PID@tie{}1. @end defvar diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 0de3c9c55c..5f2625ac20 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013-2016, 2018-2024 Ludovic Courtès +;;; Copyright © 2013-2016, 2018-2025 Ludovic Courtès ;;; Copyright © 2017 Clément Lassieur ;;; Copyright © 2018 Carlo Zancanaro ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen @@ -81,6 +81,8 @@ (define-module (gnu services shepherd) shepherd-service-upgrade user-processes-service-type + shepherd-timer-service-type + shepherd-transient-service-type assert-valid-graph)) @@ -668,4 +670,52 @@ (define user-processes-service-type seconds after @code{SIGTERM} has been sent are terminated with @code{SIGKILL}."))) -;;; shepherd.scm ends here + +;;; +;;; Timer and transient service maker. +;;; + +(define shepherd-timer-service-type + (shepherd-service-type + 'shepherd-timer + (const (shepherd-service + (provision '(timer)) + (requirement '(user-processes)) + (modules '((shepherd service timer))) + (free-form #~(timer-service + '#$provision + #:requirement '#$requirement)))) + #t ;ignored + (description "The Shepherd @code{timer} service lets you schedule commands +dynamically, similar to the @code{at} command that your grandparents would use +on that Slackware they got on a floppy disk. For example, consider this +command: + +@example +herd schedule timer at 07:00 -- mpg123 Music/alarm.mp3 +@end example + +It does exactly what you would expect."))) + +(define shepherd-transient-service-type + (shepherd-service-type + 'shepherd-transient + (const (shepherd-service + (provision '(transient)) + (requirement '(user-processes)) + (modules '((shepherd service transient))) + (free-form #~(transient-service + '#$provision + #:requirement '#$requirement)))) + #t ;ignored + (description "The Shepherd @code{transient} service lets you run commands +asynchronously, in the background, similar to @command{systemd-run}, as in +this example: + +@example +herd spawn transient -E SSH_AUTH_SOCK=$SSH_AUTH_SOCK -- \\ + rsync -e ssh -vur . backup.example.org: +@end example + +This runs @command{rsync} in the background, as a service that you can inspect +with @command{herd status} and stop with @command{herd stop}."))) From patchwork Fri Jan 17 22:19:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37121 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 6597B27BBEA; Fri, 17 Jan 2025 22:21:27 +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=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED 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 A10C327BBEB for ; Fri, 17 Jan 2025 22:21:21 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYuiB-0006F7-2N; Fri, 17 Jan 2025 17:21: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 1tYui9-0006E3-05 for guix-patches@gnu.org; Fri, 17 Jan 2025 17:21:05 -0500 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 1tYui8-0002gV-EE; Fri, 17 Jan 2025 17:21:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=yT7aNWDnkRmlUk0aoFpJXyl868iZ8OYADbB1ksh1kdo=; b=tU+yd4PcR4xze9iex1nSjzrqBtYq3G6pfsulDhk0yvl4glZX5xC6LiE/WhZvjE41m8Dr8+rjowiI2pTtzH9+h4+w0ATJxibLco3BET7+g6KyfyYM/7jIvyVRF71FVA3dBNxu/PBlvYQWOzXXX/dL3r0rA9wWj1JheF5Tz7YqsxV2STrV0GJrA5v+nsSro/ozzW0oq4khTxYNiwFe7KrIgXH4btxHiizMVjS+e8XwQ/bLYuTdJ9UTBo7A+w24grxMPlV0MzSRuBkphen5OFaiMDIaOP4c006mietoOEIl1Q4omLNe66US9a4QbwTKkVfSGPcZ0saAPSw+0d7ctO61lw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tYui6-0002YT-It; Fri, 17 Jan 2025 17:21:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74997] [PATCH 2/4] services: Add the =?utf-8?b?U2hlcGhlcmQ=?= =?utf-8?b?4oCZcyDigJh0cmFuc2llbnTigJk=?= and =?utf-8?b?4oCYdGltZXLigJk=?= to =?utf-8?b?4oCYJWJhc2Utc2VydmljZXPigJku?= Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: herman@rimm.ee, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Fri, 17 Jan 2025 22:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74997 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74997@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Herman Rimm , Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Herman Rimm , Ludovic =?utf-8?q?Cour?= =?utf-8?q?t=C3=A8s?= Received: via spool by 74997-submit@debbugs.gnu.org id=B74997.17371524159692 (code B ref 74997); Fri, 17 Jan 2025 22:21:02 +0000 Received: (at 74997) by debbugs.gnu.org; 17 Jan 2025 22:20:15 +0000 Received: from localhost ([127.0.0.1]:39136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tYuhL-0002WF-5S for submit@debbugs.gnu.org; Fri, 17 Jan 2025 17:20:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35816) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tYuh8-0002P3-FC for 74997@debbugs.gnu.org; Fri, 17 Jan 2025 17:20:03 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYuh2-0002LV-Po; Fri, 17 Jan 2025 17:19:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=yT7aNWDnkRmlUk0aoFpJXyl868iZ8OYADbB1ksh1kdo=; b=Fuhg/lDWnD5euccBXUaI I80fE/XXD9Ql0ZLBOWHJXoH6IDLq/nls1TkVdP9JqiQUmxS6nBxVRkKMHulc5nV8brBJjzG9HkwxE FRWnI+lmtsdmG4ecbJHbA5Xg+qqUwt707euValRIOi6qTZBuEKpllx829+bqDR+ZPf2wn+s4clUh6 sTPncEcxndT+OBtkKb0AiTUI1D//qZ/u0ppHrZphRTtM/Y8TtRJhs5SkC1tM3ZLqbQ1GvUxnlr6VQ XKHLOt7zO2oiKnbpx27Kdar89veH+Hkk63ydUC8vvIt9fPMzh26oPJGa0OTdz/2k6Xd6K9YKQpRCV MKEheM6kbcyk0w==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 17 Jan 2025 23:19:21 +0100 Message-ID: X-Mailer: git-send-email 2.47.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/base.scm (%base-services): Add instances of ‘shepherd-timer-service-type’ and ‘shepherd-transient-service-type’. Change-Id: I28a35d0dce40b142ee71b330b1cf7a3d222ef6bd Reviewed-by: Maxim Cournoyer --- gnu/services/base.scm | 4 ++++ gnu/services/shepherd.scm | 34 ++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 5967457002..7331c030d7 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -3750,6 +3750,10 @@ (define %base-services (service log-rotation-service-type) + ;; Convenient services brought by the Shepherd. + (service shepherd-timer-service-type) + (service shepherd-transient-service-type) + ;; Periodically delete old build logs. (service log-cleanup-service-type (log-cleanup-configuration diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 5f2625ac20..328bfbedff 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -678,14 +678,15 @@ (define user-processes-service-type (define shepherd-timer-service-type (shepherd-service-type 'shepherd-timer - (const (shepherd-service - (provision '(timer)) - (requirement '(user-processes)) - (modules '((shepherd service timer))) - (free-form #~(timer-service - '#$provision - #:requirement '#$requirement)))) - #t ;ignored + (lambda (requirement) + (shepherd-service + (provision '(timer)) + (requirement requirement) + (modules '((shepherd service timer))) + (free-form #~(timer-service + '#$provision + #:requirement '#$requirement)))) + '(user-processes) (description "The Shepherd @code{timer} service lets you schedule commands dynamically, similar to the @code{at} command that your grandparents would use on that Slackware they got on a floppy disk. For example, consider this @@ -700,14 +701,15 @@ (define shepherd-timer-service-type (define shepherd-transient-service-type (shepherd-service-type 'shepherd-transient - (const (shepherd-service - (provision '(transient)) - (requirement '(user-processes)) - (modules '((shepherd service transient))) - (free-form #~(transient-service - '#$provision - #:requirement '#$requirement)))) - #t ;ignored + (lambda (requirement) + (shepherd-service + (provision '(transient)) + (requirement requirement) + (modules '((shepherd service transient))) + (free-form #~(transient-service + '#$provision + #:requirement '#$requirement)))) + '(user-processes) (description "The Shepherd @code{transient} service lets you run commands asynchronously, in the background, similar to @command{systemd-run}, as in this example: From patchwork Fri Jan 17 22:19:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37122 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 073DC27BBEA; Fri, 17 Jan 2025 22:21:35 +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=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, 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 7D5E627BBE2 for ; Fri, 17 Jan 2025 22:21:34 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYuiD-0006GB-PM; Fri, 17 Jan 2025 17:21:10 -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 1tYuiC-0006FT-0g for guix-patches@gnu.org; Fri, 17 Jan 2025 17:21:08 -0500 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 1tYuiB-0002hB-IS; Fri, 17 Jan 2025 17:21:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=k+2X3Z70cToyD0NvQfPSifNY8fOMJUycuzqUUgkZ8Mo=; b=pH4igSYBsEZfK0t/8EBZDeihn1i7c58lLqr9Oju2rUpEiso0TW/6u5vaVcBg+GqF07EDArp+MWsXefvYJRohX4YFdfmCkzexgCXCp4gCHDp+DfSOma2QJLxKbURDLVmCEvPHFUvyuv02yavTl5HXL5s7g6hBkmr9UzkOw3WJkpaSB2zxbR7dKwq3yGbkZkKYYeoNAPVqhx9BRTTSZzMOIFkhfFU8Uo8yWUaRxcpIqwtgz9dfvEMJ4Y/pEvSBlKXm9a5QR5ASH6uw/BGUx19zBnGo4brOOOzOhJ9qu2ztUOgsfvtHLTCpQLH8w3KMb43OFG3QSmUI/bL1CQqvVm0G/Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tYui7-0002Yc-2H; Fri, 17 Jan 2025 17:21:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74997] [PATCH 3/4] home: services: shepherd: Add =?utf-8?b?4oCYdHJhbnNpZW504oCZ?= and =?utf-8?b?4oCYdGltZXLigJk=?= services. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: herman@rimm.ee, ludo@gnu.org, andrew@trop.in, janneke@gnu.org, maxim.cournoyer@gmail.com, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Fri, 17 Jan 2025 22:21:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74997 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74997@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Herman Rimm , Ludovic =?utf-8?q?Court=C3=A8s?= , Andrew Tropin , Janneke Nieuwenhuizen , Maxim Cournoyer , Tanguy Le Carrour X-Debbugs-Original-Xcc: Herman Rimm , Ludovic =?utf-8?q?Cour?= =?utf-8?q?t=C3=A8s?= , Andrew Tropin , Janneke Nieuwenhuizen , Maxim Cournoyer , Tanguy Le Carrour Received: via spool by 74997-submit@debbugs.gnu.org id=B74997.17371524169700 (code B ref 74997); Fri, 17 Jan 2025 22:21:03 +0000 Received: (at 74997) by debbugs.gnu.org; 17 Jan 2025 22:20:16 +0000 Received: from localhost ([127.0.0.1]:39138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tYuhL-0002WH-Io for submit@debbugs.gnu.org; Fri, 17 Jan 2025 17:20:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36652) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tYuhB-0002P7-LQ for 74997@debbugs.gnu.org; Fri, 17 Jan 2025 17:20:06 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYuh6-0002MA-5L; Fri, 17 Jan 2025 17:20:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=k+2X3Z70cToyD0NvQfPSifNY8fOMJUycuzqUUgkZ8Mo=; b=cCWj278F11FkLgkeXfbs H1t018v0Te5ZlO1cC6yyyyayG+6eObkBHvqSHG8QmUPWAtjt85e/JSq6ZI6p5wTnp9zmIOY1OmAHJ 4kIJJqxBaSLbo8EJNzkbHfx4ZaT0P7r61WUV3AxtxCAw1Oz1yzFZJ3PEKYkIbjJbdNgfXkdO4waCs cIGdjY2Vyw6qAr0YlvfO3TYVEf9vzxjFvXjZ4Kblf7Y3rmXpwA4nvosYCG56Xer8hBDIkWAUly1HE rgUSZZyWC9uZR8oBDIlBWYnZrljkgxyYKvPEoEXr0g+j04XVWyYPyHnQQKVKzFsapW3m8VsGYH2aj QU8TFDPlU82nRw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 17 Jan 2025 23:19:22 +0100 Message-ID: X-Mailer: git-send-email 2.47.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/home/services/shepherd.scm (home-shepherd-timer-service-type) (home-shepherd-transient-service-type): New variables. * doc/guix.texi (Shepherd Home Service): Document them. (Shepherd Services): Add anchor. Change-Id: Ia4eb7cf043f4661c64f5ca81b8989a451532aa18 Reviewed-by: Maxim Cournoyer --- doc/guix.texi | 12 ++++++++++++ gnu/home/services/shepherd.scm | 21 +++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 3e377ca9f4..a33f2f3083 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -45684,6 +45684,7 @@ Shepherd Services (shepherd my-shepherd)))))) @end lisp +@anchor{shepherd-transient-timer-services} @cindex @code{transient} service, Shepherd @defvar shepherd-transient-service-type This service type represents the Shepherd's @code{transient} service, @@ -47347,6 +47348,17 @@ Shepherd Home Service This service is part of @code{%base-home-services}. @end defvar +@defvar home-shepherd-transient-service-type +@defvarx home-shepherd-timer-service-type +These are the @code{timer} and @code{transient} Shepherd services. The +former lets you schedule command execution for later, while the latter +can run commands in the background as a regular service. + +@xref{shepherd-transient-timer-services, the system @code{timer} and +@code{transient} services}, which are their Guix System counterparts, +for more info. +@end defvar + @node Secure Shell @subsection Secure Shell diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm index 37ad1489d6..b2b141d4de 100644 --- a/gnu/home/services/shepherd.scm +++ b/gnu/home/services/shepherd.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021, 2023 Andrew Tropin ;;; Copyright © 2021 Xinglu Chen -;;; Copyright © 2024 Ludovic Courtès +;;; Copyright © 2024-2025 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,7 +34,10 @@ (define-module (gnu home services shepherd) home-shepherd-configuration-auto-start? home-shepherd-configuration-daemonize? home-shepherd-configuration-silent? - home-shepherd-configuration-services) + home-shepherd-configuration-services + + home-shepherd-transient-service-type + home-shepherd-timer-service-type) #:re-export (shepherd-service shepherd-service? shepherd-service-documentation @@ -181,3 +184,17 @@ (define home-shepherd-service-type (define-service-type-mapping shepherd-root-service-type => home-shepherd-service-type) + +;;; +;;; Timer and transient service maker. +;;; + +(define home-shepherd-timer-service-type + (service-type + (inherit (system->home-service-type shepherd-timer-service-type)) + (default-value '()))) ;requirement + +(define home-shepherd-transient-service-type + (service-type + (inherit (system->home-service-type shepherd-transient-service-type)) + (default-value '()))) ;requirement From patchwork Fri Jan 17 22:19:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37123 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 C0D0627BBEA; Fri, 17 Jan 2025 22:21:41 +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=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, 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 7FFD027BBE2 for ; Fri, 17 Jan 2025 22:21:41 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYuiE-0006GT-9z; Fri, 17 Jan 2025 17:21:10 -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 1tYuiC-0006FU-39 for guix-patches@gnu.org; Fri, 17 Jan 2025 17:21:08 -0500 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 1tYuiB-0002hC-LY; Fri, 17 Jan 2025 17:21:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=3Wc1I+hodyphu/XxYbt2uoG+30U3kayLyQSKT2t+13k=; b=f6tJYZyQC4wLAZ8Jx9/o5JhjHv19ONxD0LGAhq43SyaGMx+fhUvIrUxyn0/7iejvwlYmWjRUlM3G3dK4wH76GpwsJ9ROSGVaFcPyZep9iaS1bvl5YeP/SWMg50kN6qf475dsHt5Gl8dTwRdnWCGzuOV3CuTnF2cLWtFZmmSVecN/YkkAmRw15dTv81amZRAQpzpjfzbewcTqfNijxRNVmTbDFwHo/pq+bq6uchfiAW11SMklbaHaoCuHrkBOkYbl4XBYfkCa8vccXYbo5jYyuq/Z2HHO+8R54oUf/x9fS239rCIvUpZHFL5IWFdhqk58jXUdkbX2rNhP3geTdW+jUg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tYui7-0002Yw-Hg; Fri, 17 Jan 2025 17:21:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74997] [PATCH 4/4] home: services: Add =?utf-8?b?4oCYdHJhbnNp?= =?utf-8?b?ZW504oCZ?= and =?utf-8?b?4oCYdGltZXLigJk=?= to =?utf-8?b?4oCYJWJh?= =?utf-8?b?c2UtaG9tZS1zZXJ2aWNlc+KAmS4=?= Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: herman@rimm.ee, ludo@gnu.org, andrew@trop.in, janneke@gnu.org, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Fri, 17 Jan 2025 22:21:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74997 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74997@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Herman Rimm , Ludovic =?utf-8?q?Court=C3=A8s?= , Andrew Tropin , Janneke Nieuwenhuizen , Tanguy Le Carrour X-Debbugs-Original-Xcc: Herman Rimm , Ludovic =?utf-8?q?Cour?= =?utf-8?q?t=C3=A8s?= , Andrew Tropin , Janneke Nieuwenhuizen , Tanguy Le Carrour Received: via spool by 74997-submit@debbugs.gnu.org id=B74997.17371524169706 (code B ref 74997); Fri, 17 Jan 2025 22:21:03 +0000 Received: (at 74997) by debbugs.gnu.org; 17 Jan 2025 22:20:16 +0000 Received: from localhost ([127.0.0.1]:39140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tYuhM-0002WP-3F for submit@debbugs.gnu.org; Fri, 17 Jan 2025 17:20:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36666) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tYuhD-0002PR-Cq for 74997@debbugs.gnu.org; Fri, 17 Jan 2025 17:20:08 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYuh8-0002Nc-15; Fri, 17 Jan 2025 17:20:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=3Wc1I+hodyphu/XxYbt2uoG+30U3kayLyQSKT2t+13k=; b=Nb+LqdGakMgqmGtSsYUi 8eoczTerOrJWGpmR9SX2eiyVnqQJQ7MPSLgczW/XGAjxbYetCIIgO/QS0DsZrPbvyyH7t10skjwPz xOlbVmVqyUam3Ubg0K6rtWaPUfVrglrECec2unaxlRCVaunXoacVEbdMvbJHYmKtLbwOyVW2/ZCkz yqclyPA7TsuK0Z3yS5KUo3U7g2jZCll8QKI51Gna59m5DxqxeJTYdT1u7/6PQL+d0z7gxRuRpfD9d qmtNa5ecczE7MnKuXBmcVwtabPfl/4mPUDU8Jki+5MUQ3X2Ur/uaAajdA5TxsZFRugU5KGBnPJUpo pTIoxQ80xNERig==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 17 Jan 2025 23:19:23 +0100 Message-ID: X-Mailer: git-send-email 2.47.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/home.scm (%base-home-services): Add ‘home-shepherd-timer-service-type’ and ‘home-shepherd-transient-service-type’. Change-Id: Ib48744b82c7e4c6ff6b8ac3d669774feda813f4b Reviewed-by: Maxim Cournoyer --- gnu/home.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnu/home.scm b/gnu/home.scm index 3b479f64f9..1172b1a0ab 100644 --- a/gnu/home.scm +++ b/gnu/home.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Andrew Tropin -;;; Copyright © 2022, 2024 Ludovic Courtès +;;; Copyright © 2022, 2024-2025 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +21,7 @@ (define-module (gnu home) #:use-module (gnu home services) #:use-module (gnu home services symlink-manager) #:use-module (gnu home services shells) + #:use-module (gnu home services shepherd) #:use-module (gnu home services xdg) #:use-module (gnu home services fontutils) #:use-module (gnu home services admin) @@ -80,7 +81,9 @@ (define-record-type* home-environment (define %base-home-services ;; Non-essential but useful services to have by default. - (list (service home-log-rotation-service-type))) + (list (service home-log-rotation-service-type) + (service home-shepherd-timer-service-type) + (service home-shepherd-transient-service-type))) (define (home-environment-default-essential-services he) "Return the list of essential services for home environment."