From patchwork Sat Mar 15 21:37:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 40216 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 4DB6B27BBE9; Sat, 15 Mar 2025 21:38: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=-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 33D2627BBE2 for ; Sat, 15 Mar 2025 21:38:18 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZCo-0004iB-9D; Sat, 15 Mar 2025 17:38: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 1ttZCk-0004hs-PK for guix-patches@gnu.org; Sat, 15 Mar 2025 17:38:02 -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 1ttZCk-0002hT-F1 for guix-patches@gnu.org; Sat, 15 Mar 2025 17:38: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:References:In-Reply-To:Date:From:To:Subject; bh=FbUeOlvz3y9CaSJr/qoT34k83YuGWxyvCpr7QLU5eMQ=; b=ADvYeS1LWeO8gmeVzIlU4i9r5yCm7FTP5TMLjJdOOPCT+/Hby0iBsjVbGVGGVwPuD+ufbw/csKlYb9UvvQgyZ1LtpGNr0MgU3XB1bGPmqmhYN+kHe2lFAm2usfkdmRHayLYSrygPI+wOOuRBSuJZZsCMpioevwny9IMQEA/RHjRgskdEN9uHYJ20WsekezooBXWWzsjWWbizMWFSwHJomExO9C4rao16PuxijZHpo5H0gwwGfK/4Vfgm9Sm93HGz5CDh8B+Xz2VTA8tQdoMCx6zfHATo9CxdfapOGa+lWCObrJIXiodPLcHfPi+r+FGOJqGAIeUrXDip0DDfadbHGQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZCk-0004N4-83 for guix-patches@gnu.org; Sat, 15 Mar 2025 17:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 01/16] services: shepherd: Factorize =?utf-8?b?4oCYdHJpZ2dlcuKAmQ==?= action. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207468016773 (code B ref 77041); Sat, 15 Mar 2025 21:38:02 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:00 +0000 Received: from localhost ([127.0.0.1]:43812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZCi-0004MS-6O for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53234) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCf-0004LH-1L for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:37:58 -0400 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 1ttZCZ-0002fi-GQ; Sat, 15 Mar 2025 17:37:51 -0400 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=FbUeOlvz3y9CaSJr/qoT34k83YuGWxyvCpr7QLU5eMQ=; b=r8klLKIXG8zokZ3fXgMt UNGOfVq0cEoLINCd+LsGSCGnoPctBcOHMxl1gmXTcP+bF88yunXfzK9GItQyl1t2Lolv0KqDJm8uF OwmTZKx4r98K1Sr5N6pmop+Qrg8VEDTJCDrc7uUqAYkhifPhn5duktpA3p+jifdZjM4QhnyAehe8F S4v7XNCJFQPFSogDoFqp7E0xkAIn8AaEgOhicDEif8BPpSWZLX+G3tOlhsoZskGOo8i6s4FuoLXhh gJO/qPBzAWnncQOVuqCK/yofInXt9HZin4fLMMpI4hRsPGAXIIDthUIeARZZ11tSOlydJBW90iIKL zcX9izkjUfOCAw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:07 +0100 Message-ID: <8849153c52dfe2ceec61a2cdbf3c07cb3363ff7d.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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-trigger-action): New variable. * gnu/services/admin.scm (log-cleanup-shepherd-services) (unattended-upgrade-shepherd-services): Use it. * gnu/services/backup.scm (restic-backup-job->shepherd-service): Use it. Change-Id: I834b5b9b61c78f012ee9306df6cf4fd8a93dd6d2 --- gnu/services/admin.scm | 10 ++-------- gnu/services/backup.scm | 6 +----- gnu/services/shepherd.scm | 8 ++++++++ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 2a11a4f4f1..726ca5f918 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -404,10 +404,7 @@ (define (log-cleanup-shepherd-services configuration) schedule) (command '(#$program)))) (stop #~(make-timer-destructor)) - (actions (list (shepherd-action - (name 'trigger) - (documentation "Trigger log cleanup.") - (procedure #~trigger-timer)))) + (actions (list shepherd-trigger-action)) (documentation "Periodically delete old log files.")))))) (define log-cleanup-service-type @@ -671,10 +668,7 @@ (define (unattended-upgrade-shepherd-services config) ;; again. #:wait-for-termination? #t)) (stop #~(make-timer-destructor)) - (actions (list (shepherd-action - (name 'trigger) - (documentation "Trigger unattended system upgrade.") - (procedure #~trigger-timer))))))) + (actions (list shepherd-trigger-action))))) (define unattended-upgrade-service-type (service-type diff --git a/gnu/services/backup.scm b/gnu/services/backup.scm index 4d8cf167f0..6e066bd3d6 100644 --- a/gnu/services/backup.scm +++ b/gnu/services/backup.scm @@ -255,11 +255,7 @@ (define (restic-backup-job->shepherd-service config) max-duration))) (stop #~(make-timer-destructor)) - (actions (list (shepherd-action - (name 'trigger) - (documentation "Manually trigger a backup, -without waiting for the scheduled time.") - (procedure #~trigger-timer))))))) + (actions (list shepherd-trigger-action))))) (define (restic-guix-wrapper-package jobs) (package diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 65c49b9c59..e7e414b920 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -72,6 +72,7 @@ (define-module (gnu services shepherd) shepherd-action-procedure shepherd-configuration-action + shepherd-trigger-action %default-modules @@ -404,6 +405,13 @@ (define (shepherd-configuration-action file) (format #t "~a~%" #$file) #$file)))) +(define shepherd-trigger-action + ;; Action to trigger a timer. + (shepherd-action + (name 'trigger) + (documentation "Trigger immediate execution of this timer.") + (procedure #~trigger-timer))) + (define (shepherd-configuration-file services shepherd) "Return the shepherd configuration file for SERVICES. SHEPHERD is used as shepherd package." From patchwork Sat Mar 15 21:37:08 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: 40217 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 345E427BBEA; Sat, 15 Mar 2025 21:38:34 +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 856BD27BBE2 for ; Sat, 15 Mar 2025 21:38:33 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZCt-0004ir-GP; Sat, 15 Mar 2025 17:38:11 -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 1ttZCm-0004i3-8U for guix-patches@gnu.org; Sat, 15 Mar 2025 17:38:05 -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 1ttZCl-0002hj-UH; Sat, 15 Mar 2025 17:38: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:References:In-Reply-To:Date:From:To:Subject; bh=FfeSNCX34H322dFDzxetgcIGQ2v4iDzjZmbUHzviTHg=; b=qolz+RGpbtwUkD6/TmUkdPE0+kJ3zmhrU1NozX0kQteK/amPxwjTEFkGoOXLT+cG2SRSkEB75ruk5zi6P3JUKO8XcL8Kj0L7RFfooPt4Le4fbNmZmEGC4qiMI3fj/TNWgISSrolk/k98zqCjaOWqIPGlygXEwxrxALV6ABBtZjX6Dyh07GffxqXAeS0xBY+ntHI1keMjT68RdpWtgNBC4u9o6QC8/H8x5+f8XgCrP+Z2ZqDbY1K9BYrRXGp3kUS7PjmnmA35bNc57ccc/wQzCk64o4RUsbsN3SjrGmFHlQRS9m9wBzgWxgXRrChZuQO590CMSaK3DZZ2mXUFkMy01A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZCk-0004ND-T4; Sat, 15 Mar 2025 17:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 02/16] services: file-database: Turn into a Shepherd timer. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207468116785 (code B ref 77041); Sat, 15 Mar 2025 21:38:02 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:01 +0000 Received: from localhost ([127.0.0.1]:43814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZCi-0004MZ-Mk for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53250) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCf-0004LN-Vg for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:37:59 -0400 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 1ttZCa-0002g2-LE; Sat, 15 Mar 2025 17:37:52 -0400 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=FfeSNCX34H322dFDzxetgcIGQ2v4iDzjZmbUHzviTHg=; b=L6D8b74f1Gu7ZoQzJS0K EHZCI1P2C6+3+bl8Dgn5u3C1PVr4yCmTXIhH1Lkk6VSMEYTuqa+JSl6dbuWg0B39d3A5CmXrElizk a/rkWPPOVS/ANbczR0wlL8yLZHJ4sNqtWOwMV2zLwU+sxXDZNs9320ome0mLTRrCHe7EUtafyJFZL 9kYMqR4GEIvzWFgJnDFxwmcVC/SKld7TK3yg63ReFqa5+wL/iVorv+eCzyA5lY8EV6dS+VVbBsk4/ nuvqzWOXjZGbG9wKRpGxj2vTKPFqvHnvsi7DEY0MJHIZ/hONdhsLyGBIUNisujwf2t2gZmFZebItx 3Donzf9y1K7idw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:08 +0100 Message-ID: <7e1843fdb5c8d0ebe4f3002ea7beb041f0622f5a.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/admin.scm (file-database-mcron-jobs): Rename to… (file-database-shepherd-services): … this. Return a list of Shepherd services. (file-database-service-type): Adjust accordingly. * doc/guix.texi (File Search Services): Update documentation of ‘schedule’. Change-Id: I5734c629b113e54057694d2ec480abd26b7815db --- doc/guix.texi | 5 +++-- gnu/services/admin.scm | 22 ++++++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index d109877a32..ae7b08ad23 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -27152,8 +27152,9 @@ File Search Services is taken. @item @code{schedule} (default: @code{%default-file-database-update-schedule}) -String or G-exp denoting an mcron schedule for the periodic -@command{updatedb} job (@pxref{Guile Syntax,,, mcron, GNU@tie{}mcron}). +This is the schedule of database updates, expressed as a string in +traditional cron syntax or as a gexp evaluating to a Shepherd calendar +event (@pxref{Timers,,, shepherd, The GNU Shepherd Manual}). @item @code{excluded-directories} (default @code{%default-file-database-excluded-directories}) List of regular expressions of directories to ignore when building the diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 726ca5f918..5f5b76ffbb 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -462,7 +462,7 @@ (define-configuration/no-serialization file-database-configuration guix locate}). This list is passed to the @option{--prunepaths} option of @command{updatedb} (@pxref{Invoking updatedb,,, find, GNU@tie{}Findutils}).")) -(define (file-database-mcron-jobs configuration) +(define (file-database-shepherd-services configuration) (match-record configuration (package schedule excluded-directories) (let ((updatedb (program-file @@ -481,13 +481,27 @@ (define (file-database-mcron-jobs configuration) #$(string-append "--prunepaths=" (string-join excluded-directories))))))) - (list #~(job #$schedule #$updatedb))))) + (list (shepherd-service + (provision '(file-database-update)) + (requirement '(user-processes)) + (modules '((shepherd service timer))) + (start #~(make-timer-constructor + #$(if (string? schedule) + #~(cron-string->calendar-event #$schedule) + schedule) + (command '(#$updatedb)) + #:wait-for-termination? #t)) + (stop #~(make-timer-destructor)) + (documentation + "Periodically update the system-wide file database that can be +queried by the 'locate' command.") + (actions (list shepherd-trigger-action))))))) (define file-database-service-type (service-type (name 'file-database) - (extensions (list (service-extension mcron-service-type - file-database-mcron-jobs))) + (extensions (list (service-extension shepherd-root-service-type + file-database-shepherd-services))) (description "Periodically update the file database used by the @command{locate} command, which lets you search for files by name. The database is created by running From patchwork Sat Mar 15 21:37:09 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: 40219 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 692B227BBE2; Sat, 15 Mar 2025 21:39:15 +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 F0EF227BBE2 for ; Sat, 15 Mar 2025 21:39:14 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDk-0004tj-Fh; Sat, 15 Mar 2025 17:39:04 -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 1ttZDi-0004tL-7T for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:02 -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 1ttZDh-0002m1-Tl for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:01 -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:References:In-Reply-To:Date:From:To:Subject; bh=9eL9AEjaF2tnAIBILCGkih41DWt5i+SsLqMRM5LtqxM=; b=FOUQbLvTjuHbpJ6HC7fmqGh128Up9AzizAtCGSA4LSBfp673Kriok+K4sL7JWD/5V48eLTSNpkYPADtaMLAeG3x9g1YiqYZbK7HJdg3CG+N0LsrD04bu8/tSBK61pPjqQNVm1VYHWPFbq4q1/6b6zn/Eu5K2nrRlbpFQEAp/nI0k0pmGKwcv5awRchNiOxzCN4+phSYha3CgjFl0iTQ09x6j+6y2DApEIdQUUXZE8wovzX+HYNkZ27IUxZUviR9Vh7zWDFlwl/GMQQFzvULI4Wc3M/WEN7WaOtd7G1oh0cTzo1Kvf/eZVyJ0GSQIy5Wi3pw9FqCUxyDu4BgQZWgmAw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDh-0004Uc-Nr for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 03/16] services: file-database: Exclude /dev by default. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207469716957 (code B ref 77041); Sat, 15 Mar 2025 21:39:01 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:17 +0000 Received: from localhost ([127.0.0.1]:43837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZCv-0004Ol-FS for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53264) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCi-0004Lj-LD for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:00 -0400 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 1ttZCc-0002gH-Pf; Sat, 15 Mar 2025 17:37:54 -0400 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=9eL9AEjaF2tnAIBILCGkih41DWt5i+SsLqMRM5LtqxM=; b=e8ZqZaJpyQgQF9gz+gs0 1TLJkkdluknonxJyP/Y+TgVbqoVJAL13QLqb0Mad7IC8hcYAkaoYp6SwdBzmAJS1/YSI/6h6haIFk vIScVRroSSOoVgGRLWVul+9J0u7dKBrdlSr5kvc/cTJA40qeHeeYliGhm6P1eQvZ/oMCVVlm8tkoG nX+1xqT2mQv8mXkmcynZSGzaXQ0pH0M0WGuawh1h3J9S9u8U2V+NANedFb2DFZ+Aj7mAdSwvCRKA/ BZXUJpbNQe+VFKk/qynRnudD1DoTPOT6ZYtaGrVqdb3QncGAJMZlBSLb87ro6leJlWAS23eZyIfcd rMTH59g+ofOmVQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:09 +0100 Message-ID: <198fd0abf3a0d64f44b1fae7eae99b721fb8d38f.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/admin.scm (%default-file-database-excluded-directories): Add “/dev’. Change-Id: I06af6621cd363e140a6fc49e1cee97d15b365b89 --- gnu/services/admin.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 5f5b76ffbb..b73accc4af 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -430,7 +430,7 @@ (define %default-file-database-excluded-directories ;; Regexps of directories excluded from the 'locate' database. (list (%store-prefix) "/tmp" "/var/tmp" "/var/cache" ".*/\\.cache" - "/run/udev")) + "/run/udev" "/dev")) (define (string-or-gexp? obj) (or (string? obj) (gexp? obj))) From patchwork Sat Mar 15 21:37:10 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: 40225 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 3856B27BBEC; Sat, 15 Mar 2025 21:39:54 +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 8E2FB27BBE2 for ; Sat, 15 Mar 2025 21:39:53 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDl-0004tz-IH; Sat, 15 Mar 2025 17:39: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 1ttZDi-0004tZ-RH for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:02 -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 1ttZDi-0002mG-EK; Sat, 15 Mar 2025 17:39: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:References:In-Reply-To:Date:From:To:Subject; bh=l4JVBgpTFUvjF2wVzspUV72xkD12SP8VYV0Bj+Bh2kA=; b=gVOaVe5l9o1v1Y65p6bENEozyHE52xyxRZ3oMZkbCfO/yviTqUCFkhq8H5bHQDP8W8aQeFmJKz24Z7zThARMo5D0Is9E+z9LNXB8KdKi1rOXQpbU7qShOvTRfLOqSWK9HJXXpD37POgGp4BK5eV57XjBDfgtQfzCv8sBfOfDfgCzF79wg1y5KWE22gM0ZBD68ahBKYaxLkVXz6MrNf8MtdTW9jXOH96dVvy3TCFBgxsUonQjFddJBpi4RtOX5wiGww8JVpnL4+SThXQKn3Jk53HUQbgh9GHaAs8nLX9AtEN/1+qzyEXASivo3IDa+F4K+Zo7lCKzlLyJNf9XLi0oEg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDi-0004Ul-6f; Sat, 15 Mar 2025 17:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 04/16] services: package-database: Turn into a Shepherd timer. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207470217003 (code B ref 77041); Sat, 15 Mar 2025 21:39:02 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:22 +0000 Received: from localhost ([127.0.0.1]:43843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZCy-0004PQ-4f for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53280) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCj-0004Lo-2h for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:01 -0400 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 1ttZCd-0002gQ-Ko; Sat, 15 Mar 2025 17:37:55 -0400 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=l4JVBgpTFUvjF2wVzspUV72xkD12SP8VYV0Bj+Bh2kA=; b=hBQT0Z2oXjrC2/ZdyjC/ jA/sznHLXGCDhLsOTT6/72/qQ54tTvg0GVqFxYEGi493ttzJFozrQLRwFbAFJ3XxU4+Xa+hY/ujb0 drVG+2+tJU46dKxHDAA9avTd1Li7G1dgL2CJlcm5JEU/E0rq4rf7L11mF/nHCxy7LMppL40Pdxu2p D2ao/LDrdZYpSGjOfly9OsVfgCfQ3aYD4xBe0k7RbXh+HNn9SBDyuJdcVn5uISmzl4Akee5OJtzDE xjVCad/m3qLsM/2ME2PeMjN0WRNuXcbReanvPxNF6uWVDhmW2aioAdkwY1jDImWVHY5uemzE2ucHg HF4eH2XhodsP3A==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:10 +0100 Message-ID: <1344bace2389f90a2aa26834ab4b0528e55e2c30.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/admin.scm (package-database-mcron-jobs): Rename to… (package-database-shepherd-services): … this. Return a shepherd service. (package-database-service-type): Update accordingly. * doc/guix.texi (File Search Services): Update documentation of the ‘schedule’ field. Change-Id: Id7b4c5cff95a7117dca7d95af37db7389bb5ca92 --- doc/guix.texi | 7 ++++--- gnu/services/admin.scm | 34 ++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ae7b08ad23..e45e8a9979 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -27194,9 +27194,10 @@ File Search Services The Guix package to use. @item @code{schedule} (default: @code{%default-package-database-update-schedule}) -String or G-exp denoting an mcron schedule for the periodic -@command{guix locate --update} job (@pxref{Guile Syntax,,, mcron, -GNU@tie{}mcron}). +This is the schedule of the periodic @command{guix locate --update} job, +expressed as a string in traditional cron syntax or as a gexp evaluating +to a Shepherd calendar event (@pxref{Timers,,, shepherd, The GNU +Shepherd Manual}). @item @code{method} (default: @code{'store}) Indexing method for @command{guix locate}. The default value, diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index b73accc4af..e473794043 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -529,23 +529,37 @@ (define-configuration/no-serialization package-database-configuration "G-exp denoting the channels to use when updating the database (@pxref{Channels}).")) -(define (package-database-mcron-jobs configuration) +(define (package-database-shepherd-services configuration) (match-record configuration (package schedule method channels) (let ((channels (scheme-file "channels.scm" channels))) - (list #~(job #$schedule - ;; XXX: The whole thing's running as "root" just because it - ;; needs write access to /var/cache/guix/locate. - (string-append #$(file-append package "/bin/guix") - " time-machine -C " #$channels - " -- locate --update --method=" - #$(symbol->string method))))))) + (list (shepherd-service + (provision '(package-database-update)) + (requirement '(user-processes guix-daemon)) + (modules '((shepherd service timer))) + ;; XXX: The whole thing's running as "root" just because it needs + ;; write access to /var/cache/guix/locate. + (start #~(make-timer-constructor + #$(if (string? schedule) + #~(cron-string->calendar-event #$schedule) + schedule) + (command '(#$(file-append package "/bin/guix") + "time-machine" "-C" #$channels + "--" "locate" "--update" + #$(string-append + "--method=" (symbol->string method)))) + #:wait-for-termination? #t)) + (stop #~(make-timer-destructor)) + (documentation + "Periodically update the system-wide package database that can +be queried by the 'guix locate' command.") + (actions (list shepherd-trigger-action))))))) (define package-database-service-type (service-type (name 'package-database) - (extensions (list (service-extension mcron-service-type - package-database-mcron-jobs))) + (extensions (list (service-extension shepherd-root-service-type + package-database-shepherd-services))) (description "Periodically update the package database used by the @code{guix locate} command, which lets you search for packages that provide a given file.") From patchwork Sat Mar 15 21:37:11 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: 40226 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 25B2127BBE2; Sat, 15 Mar 2025 21:39:55 +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 BC78827BBEB for ; Sat, 15 Mar 2025 21:39:53 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDs-0004xm-0D; Sat, 15 Mar 2025 17:39:12 -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 1ttZDl-0004uA-0Z for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:05 -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 1ttZDj-0002mM-A1; Sat, 15 Mar 2025 17:39: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:References:In-Reply-To:Date:From:To:Subject; bh=4n7zwMmIzO/RMLdlHaCsGGJZjAAD0aks+n0PHo6TS5s=; b=XqX1smGfKE8SWQJp4vpu+YrZXkP2NiNphLzFsq1kbm7H51T7ObmAdl9dkSb8VYMwAH/xIzshXbrmG4wOS7q7T7jte4+dDigX70lDUN+9fUqavP4ygI2g/TyCGErVPK5NnBbRoS8Tvcp8MqcBPu437bCuZqrCHZk+pbC6z+PdiE9KA/N7XPftx4GZB4aHPDbL+n6LnsvofDdOR51xV86WQ4cKmLniSSPxscIE2gTG1VI1mMXuL5ODBFlvN/DHlrwqiQY+5S9IQ8kRGwUht9wYj6COjiUj1YpyTQGtOT7RvXYmbRDDGwbHoqaov4gEic4NBIgzoRfKFAGTGY41EMLLpw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDi-0004Ux-T6; Sat, 15 Mar 2025 17:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 05/16] services: fstrim: Turn into a Shepherd timer. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207470417037 (code B ref 77041); Sat, 15 Mar 2025 21:39:02 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:24 +0000 Received: from localhost ([127.0.0.1]:43847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZD3-0004Q7-3W for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53296) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCk-0004M3-MR for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:03 -0400 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 1ttZCf-0002gb-B0; Sat, 15 Mar 2025 17:37:57 -0400 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=4n7zwMmIzO/RMLdlHaCsGGJZjAAD0aks+n0PHo6TS5s=; b=IhCCzPy1aHSMgBot1fiK bdrarpNIxre/Txlq2yfx1FGfeBFhuHeWkD1FmscpSWUUZtg0FJOdPUAgkxvJhtQspzRHSPpwr9rtg 6fR8pLPDPsHfIuWl1W8yMNbiDj6+cw27i2VaKVeiJFEtRjQx1pOOMTdxIaqouptpzNZhSvk8Mtni7 HE3S0ebOxdjRN9Gh6hsD1SrRJfWVuXW4AFsEW2KTkL/mtB4hHjBWCjUNwYZN9R6Tj4AGGK+jnbYxc bunjLn/hn4fs2XvV4TXUZkeGgF9Ha/OQ+5WDMz49JelXofpmTHf0zhUy9DOBhU14CWoCV8bh3Mf1p WXtqfE46UKzlgQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:11 +0100 Message-ID: <3fa51ca5c51d0cd271420d7387202770541f6078.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/linux.scm (mcron-time?): Remove. (shepherd-calendar-event?): New procedure. (fstrim-configuration)[schedule]: Change type to ‘shepherd-calendar-event’ and update docstring. (fstrim-mcron-job): Rename to… (fstrim-shepherd-services): … this. Return a list of Shepherd services. (fstrim-service-type): Adjust accordingly. * doc/guix.texi (Linux Services): Update. Change-Id: I9a7433cb15a1f4600470a915769d612e6e644dd8 --- doc/guix.texi | 16 +++++++++----- gnu/services/linux.scm | 50 +++++++++++++++++++++++------------------- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index e45e8a9979..da1c4adc0c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -42019,6 +42019,7 @@ Linux Services @end defvar @c %start of fragment + @deftp {Data Type} fstrim-configuration Available @code{fstrim-configuration} fields are: @@ -42026,13 +42027,13 @@ Linux Services @item @code{package} (default: @code{util-linux}) (type: file-like) The package providing the @command{fstrim} command. -@item @code{schedule} (default: @code{"0 0 * * 0"}) (type: mcron-time) -Schedule for launching @command{fstrim}. This can be a procedure, a -list or a string. For additional information, see @ref{Guile -Syntax,,Job specification,mcron,the mcron manual}. By default this is -set to run weekly on Sunday at 00:00. +@item @code{schedule} (default: @code{"0 0 * * 0"}) (type: shepherd-calendar-event) +Schedule for launching @command{fstrim}, expressed as a string in +traditional cron syntax or as a gexp evaluating to a Shepherd calendar +event (@pxref{Timers,,, shepherd,The GNU Shepherd Manual}). By default +this is set to run weekly on Sunday at 00:00. -@item @code{listed-in} (default: @code{'("/etc/fstab" "/proc/self/mountinfo")}) (type: maybe-list-of-strings) +@item @code{listed-in} (default: @code{("/etc/fstab" "/proc/self/mountinfo")}) (type: maybe-list-of-strings) List of files in fstab or kernel mountinfo format. All missing or empty files are silently ignored. The evaluation of the list @emph{stops} after the first non-empty file. File systems with @@ -42049,7 +42050,10 @@ Linux Services more information). @end table + @end deftp + + @c %end of fragment @cindex modprobe diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm index b22dbeefa0..d7aee1b82e 100644 --- a/gnu/services/linux.scm +++ b/gnu/services/linux.scm @@ -34,7 +34,6 @@ (define-module (gnu services linux) #:use-module (gnu services admin) #:use-module (gnu services base) #:use-module (gnu services configuration) - #:use-module (gnu services mcron) #:use-module (gnu services shepherd) #:use-module (gnu packages linux) #:use-module (srfi srfi-1) @@ -196,8 +195,8 @@ (define earlyoom-service-type ;;; fstrim ;;; -(define (mcron-time? x) - (or (procedure? x) (string? x) (list? x))) +(define (shepherd-calendar-event? x) + (or (string? x) (gexp? x))) (define-maybe list-of-strings (prefix fstrim-)) @@ -216,11 +215,11 @@ (define-configuration fstrim-configuration "The package providing the @command{fstrim} command." empty-serializer) (schedule - (mcron-time "0 0 * * 0") - "Schedule for launching @command{fstrim}. This can be a procedure, a list -or a string. For additional information, see @ref{Guile Syntax,, -Job specification, mcron, the mcron manual}. By default this is set to run -weekly on Sunday at 00:00." + (shepherd-calendar-event "0 0 * * 0") + "Schedule for launching @command{fstrim}, expressed as a string in +traditional cron syntax or as a gexp evaluating to a Shepherd calendar +event (@pxref{Timers,,, shepherd, The GNU Shepherd Manual}). By default this +is set to run weekly on Sunday at 00:00." empty-serializer) ;; The following are fstrim-related options. (listed-in @@ -251,26 +250,31 @@ (define (serialize-fstrim-configuration config) rcons fstrim-configuration-fields)) -(define (fstrim-mcron-job config) - (match-record config (package schedule) - #~(job - ;; Note: The “if” below is to ensure that - ;; lists are ungexp'd correctly since @var{schedule} - ;; can be either a procedure, a string or a list. - #$(if (list? schedule) - #~'(#$@schedule) - schedule) - (lambda () - (system* #$(file-append package "/sbin/fstrim") - #$@(serialize-fstrim-configuration config))) - "fstrim"))) +(define (fstrim-shepherd-services config) + (match-record config + (package schedule) + (list (shepherd-service + (provision '(fstrim)) + (requirement '(user-processes)) + (modules '((shepherd service timer))) + (start #~(make-timer-constructor + #$(if (string? schedule) + #~(cron-string->calendar-event #$schedule) + schedule) + (command + (list #$(file-append package "/sbin/fstrim") + #$@(serialize-fstrim-configuration config))) + #:wait-for-termination? #t)) + (stop #~(make-timer-destructor)) + (documentation "Periodically run the 'fstrim' command.") + (actions (list shepherd-trigger-action)))))) (define fstrim-service-type (service-type (name 'fstrim) (extensions - (list (service-extension mcron-service-type - (compose list fstrim-mcron-job)))) + (list (service-extension shepherd-root-service-type + fstrim-shepherd-services))) (description "Discard unused blocks from file systems.") (default-value (fstrim-configuration)))) From patchwork Sat Mar 15 21:37:12 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: 40218 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 B000627BBEA; Sat, 15 Mar 2025 21:39:14 +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 F38CB27BBE2 for ; Sat, 15 Mar 2025 21:39:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDn-0004vI-SO; Sat, 15 Mar 2025 17:39:08 -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 1ttZDk-0004tk-B5 for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39: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 1ttZDj-0002mV-S8 for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39: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:References:In-Reply-To:Date:From:To:Subject; bh=CPnZxR/pohpAunTFKidIoJ7AjLUZeZDa/uHrJIQ6+gA=; b=N3i4MSsSNGzRrf/HxfoUc1mMP0zkc7hZbR5YobRsMQFroYXF2WxeY35fQnDNCnCfCxxX9dKiGobvS2QhqZQcafaxzdUBUquup8SIcHHw3RaKDr3ApnLwOSfZL4vTExvau2eHkBI3OzS8f3ESpDA1yE62XU+KSd55Rgob1Z3M38kN3FNTd8lPjVCD5Pish+cqAsrbjVwIpB4TOmjXdF4uCA7s7X1GnqsXU8k4AMvBYkYaX9yIezG2618bXE/twA8u8/gFT8rrIjkxUxNA9JckbfhR50orQMyo060xrhJoTYMhMj7PNrwPsMxorgx9SFHZzWBQBrUT8iNO7l0SztWmRw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDj-0004V7-GN for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 06/16] services: certbot: Turn into a Shepherd timer. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207471917101 (code B ref 77041); Sat, 15 Mar 2025 21:39:03 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:39 +0000 Received: from localhost ([127.0.0.1]:43853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZDK-0004Rk-RO for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55764) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCp-0004N1-2r for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:07 -0400 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 1ttZCi-0002hA-Lj; Sat, 15 Mar 2025 17:38:00 -0400 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=CPnZxR/pohpAunTFKidIoJ7AjLUZeZDa/uHrJIQ6+gA=; b=r/HdSTKbPowD796gtBE7 hQJksK/Ig0gRiVeuY1XLauNkOuFSDzIkcVQOFl3Tu+XX+gGdpX8bEDlVIlBUgxoWuHQcdpJITacIL kpZGCiYd+1PEii+z+vFwJfiB8ukjtUZLScd6EpvK3KVrRzmfED9nvU5SWGx+HKFWXLSXbn9YIzsZA ZOrKdTkaRbq9jZ5ImC9yFYTuvHKnDVyUxanXxIswmKrZO8DHr8pO4TskohVb1UlFRN62IqDC0xz2m vTPD+0RVCLBwHQfMdIyzYBFdUwj5hXKH7LfaLbmQVWecy9m7FuY8DP9C65lErDYAh+uTVzF4bXtB5 Zzs5++mV+ShQlg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:12 +0100 Message-ID: <52a1dd45cb6686b3d13f8b143a0d8bcbf2b6aaab.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/certbot.scm (certbot-renewal-jobs): Rename to… (certbot-renewal-shepherd-services): … this. Return a list of Shepherd services, including ‘renew-certbot-certificates’, formally defined… (certbot-renewal-one-shot): … here. Remove. (certbot-service-type): Adjust accordingly. Change-Id: I25ad9fc1277f4f6f948ab5fce7c6626f22591d10 --- gnu/services/certbot.scm | 93 +++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 43 deletions(-) diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm index b276c49e0f..d6c7d175ff 100644 --- a/gnu/services/certbot.scm +++ b/gnu/services/certbot.scm @@ -27,7 +27,6 @@ (define-module (gnu services certbot) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) - #:use-module (gnu services mcron) #:use-module (gnu services web) #:use-module (gnu system shadow) #:use-module (gnu packages tls) @@ -220,46 +219,56 @@ (define certbot-command '#$commands) (exit script-code)))))))) -(define (certbot-renewal-jobs config) - (list - ;; Attempt to renew the certificates twice per day, at a random minute - ;; within the hour. See https://eff-certbot.readthedocs.io/. - #~(job '(next-minute-from (next-hour '(0 12)) (list (random 60))) - #$(certbot-command config)))) +(define (certbot-renewal-shepherd-services config) + (list (shepherd-service + (provision '(certbot-certificate-renewal)) + (requirement '(user-processes nginx)) + (modules '((shepherd service timer))) + (start #~(make-timer-constructor + ;; Attempt to renew the certificates twice per day. See + ;; https://eff-certbot.readthedocs.io/. + (calendar-event #:minutes '(22) #:hours '(0 12)) + (command '(#$(certbot-command config))) + #:wait-for-termination? #t)) + (stop #~(make-timer-destructor)) + (documentation "Periodically run the 'certbot' command to renew X.509 +certificates.") + (actions + (list shepherd-trigger-action + (shepherd-configuration-action (certbot-command config))))) -(define (certbot-renewal-one-shot config) - (list - ;; Renew certificates when the system first starts. This is a one-shot - ;; service, because the mcron configuration will take care of running this - ;; periodically. This is most useful the very first time the system starts, - ;; to overwrite our self-signed certificates as soon as possible without - ;; user intervention. - (shepherd-service - (provision '(renew-certbot-certificates)) - (requirement '(nginx)) - (one-shot? #t) - (start #~(lambda _ - ;; This needs the network, but there's no reliable way to know - ;; if the network is up other than trying. If we fail due to a - ;; connection error we retry a number of times in the hope that - ;; the network comes up soon. - (let loop ((attempt 0)) - (let ((code (status:exit-val - (system* #$(certbot-command config))))) - (cond - ((and (= code 2) ; Exit code 2 means connection error - (< attempt 12)) ; Arbitrarily chosen max attempts - (sleep 10) ; Arbitrarily chosen retry delay - (loop (1+ attempt))) - ((zero? code) - ;; Success! - #t) - (else - ;; Failure. - #f)))))) - (auto-start? #t) - (documentation "Call certbot to renew certificates.") - (actions (list (shepherd-configuration-action (certbot-command config))))))) + ;; Renew certificates when the system first starts. This is a one-shot + ;; service, because the timer above takes care of running this + ;; periodically. This is most useful the very first time the system + ;; starts, to overwrite our self-signed certificates as soon as + ;; possible without user intervention. + (shepherd-service + (provision '(renew-certbot-certificates)) + (requirement '(user-processes nginx)) + (one-shot? #t) + (start #~(lambda _ + ;; This needs the network, but there's no reliable way to know + ;; if the network is up other than trying. If we fail due to a + ;; connection error we retry a number of times in the hope that + ;; the network comes up soon. + (let loop ((attempt 0)) + (let ((code (status:exit-val + (system* #$(certbot-command config))))) + (cond + ((and (= code 2) ; Exit code 2 means connection error + (< attempt 12)) ; Arbitrarily chosen max attempts + (sleep 10) ; Arbitrarily chosen retry delay + (loop (1+ attempt))) + ((zero? code) + ;; Success! + #t) + (else + ;; Failure. + #f)))))) + (auto-start? #t) + (documentation "Run 'certbot' to renew certificates at boot time.") + (actions + (list (shepherd-configuration-action (certbot-command config))))))) (define (generate-certificate-gexp certbot-cert-directory rsa-key-size) (match-lambda @@ -354,10 +363,8 @@ (define certbot-service-type (compose list certbot-configuration-package)) (service-extension activation-service-type certbot-activation) - (service-extension mcron-service-type - certbot-renewal-jobs) (service-extension shepherd-root-service-type - certbot-renewal-one-shot))) + certbot-renewal-shepherd-services))) (compose concatenate) (extend (lambda (config additional-certificates) (certbot-configuration From patchwork Sat Mar 15 21:37:13 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: 40224 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 952A127BBEA; Sat, 15 Mar 2025 21:39:52 +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.5 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,URIBL_SBL_A 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 9C25727BBE9 for ; Sat, 15 Mar 2025 21:39:51 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDp-0004wL-Pf; Sat, 15 Mar 2025 17:39:09 -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 1ttZDl-0004uB-2P for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:05 -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 1ttZDk-0002mb-HS; Sat, 15 Mar 2025 17:39:04 -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:References:In-Reply-To:Date:From:To:Subject; bh=5HHc/6QaCav1JRlY25M6kGMpnpvNEh7+jyVZyIqrDnQ=; b=awbPSzWqL9TTwQ9iyf+NV3raJd7upARnE7bN9BpmdyrJQfvlpmDTYbbWtI/7DbRxrjLl2bCt9RXwWgTa0rB3q4zeb7pmEXq1vM+U4Vvl4NMNY2WmdbHcXCMELDK/4FczOKbFwOxH4Ee8PcX6AXKPSClDuZrmuBqJYnHFwrJIDWpO3631j4v0jgfcz/r9dXPaLOZqvWt3Vt8I1pI3XiXy70sLWQj3eMl8J6GHbMm9Aj5jgbhJj2tkuEUh15iR/PfxGRBkSr+ZdJggFoYksR5CWOfK44n63t9zgAMhL6W7oOolMbnZ/Sex9dJ+/H9cBQqk6pnY2d9kO8v1OrjQMtFArQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDk-0004VG-2P; Sat, 15 Mar 2025 17:39:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 07/16] services: wireguard: Turn monitoring into a Shepherd timer. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207472017114 (code B ref 77041); Sat, 15 Mar 2025 21:39:04 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:40 +0000 Received: from localhost ([127.0.0.1]:43855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZDL-0004Rr-Gb for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55752) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCp-0004N0-1A for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:08 -0400 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 1ttZCj-0002hJ-LB; Sat, 15 Mar 2025 17:38:01 -0400 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=5HHc/6QaCav1JRlY25M6kGMpnpvNEh7+jyVZyIqrDnQ=; b=klfn7GQ8FFZq2oDDaCN3 031f+VT9Tpn544VB1xjhBCP1LcovSR4Bu5mSc+LatooN9+d+EsZGQFaT2cWlWUNQgy6+l+5pOqI2B UrMTYY12d/zrK/qyvjeoJtr9W44G+wP74BY6LtzqkehTIJ1aZ757IiMMX2io2rI966iUN9aApSO5D RA8TsN5xL5ZaqwE1zUUzLzeGSkGK4m3u9wuYABPQlgfDvnAu+khZOOo+ftGifIqs8UJmiCWpsa0zK MnXfsNTio5ArnCx/E4oJXon9LJNfm3rwO93Knvy2yNe1in6V4/gywoDZ9XOnkAJbMtxAf7xkutwgC vKfLYXD9MSbh6g==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:13 +0100 Message-ID: X-Mailer: git-send-email 2.48.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/vpn.scm ()[schedule]: Change default value. (wireguard-monitoring-program): New procedure, with code taken from… (wireguard-monitoring-jobs): … here. Remove. (wireguard-shepherd-services): New procedure, with code taken from… (wireguard-shepherd-service): … here. Remove. * doc/guix.texi (VPN Services): Update. Change-Id: I6851ddf1eb9480bdc9e6c6c6b88958ab2e6225d7 --- doc/guix.texi | 7 +- gnu/services/vpn.scm | 201 ++++++++++++++++++++++--------------------- 2 files changed, 109 insertions(+), 99 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index da1c4adc0c..7f3a7ca82a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35654,9 +35654,10 @@ VPN Services name. Set this to @code{#t} if one or more endpoints use host names provided by a dynamic DNS service to keep the sessions alive. -@item @code{monitor-ips-interval} (default: @code{'(next-minute (range 0 60 5))}) -The time interval at which the IP monitoring job should run, provided as -an mcron time specification (@pxref{Guile Syntax,,,mcron}). +@item @code{monitor-ips-interval} (default: @code{"*/5 * * * *"}) +This is the monitoring schedule, expressed as a string in traditional +cron syntax or as a gexp evaluating to a Shepherd calendar event +(@pxref{Timers,,, shepherd, The GNU Shepherd Manual}). @item @code{private-key} (default: @code{"/etc/wireguard/private.key"}) The private key file for the interface. It is automatically generated diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 478a0d543e..e788ebef2e 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -34,7 +34,6 @@ (define-module (gnu services vpn) #:use-module (gnu services) #:use-module (gnu services configuration) #:use-module (gnu services dbus) - #:use-module (gnu services mcron) #:use-module (gnu services shepherd) #:use-module (gnu system shadow) #:use-module (gnu packages admin) @@ -43,6 +42,7 @@ (define-module (gnu services vpn) #:use-module (guix packages) #:use-module (guix records) #:use-module (guix gexp) + #:use-module (guix diagnostics) #:use-module (guix i18n) #:use-module (guix deprecation) #:use-module (srfi srfi-1) @@ -756,7 +756,7 @@ (define-record-type* (monitor-ips? wireguard-configuration-monitor-ips? ;boolean (default #f)) (monitor-ips-interval wireguard-configuration-monitor-ips-interval - (default '(next-minute (range 0 60 5)))) ;string | list + (default "*/5 * * * *")) ;string | list (pre-up wireguard-configuration-pre-up ;list of strings (default '())) (post-up wireguard-configuration-post-up ;list of strings @@ -916,117 +916,126 @@ (define (endpoint-host-names peers) '() peers))) -(define (wireguard-shepherd-service config) +(define (wireguard-monitoring-program config) (match-record config - (wireguard interface) + (interface monitor-ips-interval peers) + (let ((host-names (endpoint-host-names peers))) + (when (null? host-names) + (warning (G_ "'monitor-ips?' is #t but no host name to monitor~%"))) + + ;; Loosely based on WireGuard's own 'reresolve-dns.sh' shell script + ;; (see: https://raw.githubusercontent.com/WireGuard/wireguard-tools/ + ;; master/contrib/reresolve-dns/reresolve-dns.sh). + (program-file + (format #f "wireguard-~a-monitoring" interface) + (with-imported-modules (source-module-closure + '((gnu services herd) + (guix build utils))) + #~(begin + (use-modules (gnu services herd) + (guix build utils) + (ice-9 popen) + (ice-9 match) + (ice-9 textual-ports) + (srfi srfi-1) + (srfi srfi-26)) + + (define (resolve-host name) + "Return the IP address resolved from NAME." + (let* ((ai (car (getaddrinfo name))) + (sa (addrinfo:addr ai))) + (inet-ntop (sockaddr:fam sa) + (sockaddr:addr sa)))) + + (define wg #$(file-append wireguard-tools "/bin/wg")) + + #$(procedure-source strip-port/maybe) + + (define service-name + '#$(wireguard-service-name interface)) + + (when (live-service-running + (current-service service-name)) + (let* ((pipe (open-pipe* OPEN_READ wg "show" + #$interface "endpoints")) + (lines (string-split (get-string-all pipe) + #\newline)) + ;; IPS is an association list mapping + ;; public keys to IP addresses. + (ips (map (match-lambda + ((public-key ip) + (cons public-key + (strip-port/maybe ip)))) + (map (cut string-split <> #\tab) + (remove string-null? + lines))))) + (close-pipe pipe) + (for-each + (match-lambda + ((key . host-name) + (let ((resolved-ip (resolve-host + (strip-port/maybe + host-name))) + (current-ip (assoc-ref ips key))) + (unless (string=? resolved-ip current-ip) + (format #t "resetting `~a' peer \ +endpoint to `~a' due to stale IP (`~a' instead of `~a')~%" + key host-name + current-ip resolved-ip) + (invoke wg "set" #$interface "peer" key + "endpoint" host-name))))) + '#$host-names))))))))) + +(define (wireguard-shepherd-services config) + (match-record config + (wireguard interface monitor-ips? monitor-ips-interval) (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)) + (config-file (wireguard-configuration-file config))) + (define monitoring-service + (and monitor-ips? + (shepherd-service + (provision (list (symbol-append + (wireguard-service-name interface) + '-monitoring))) + (requirement (list 'user-processes + (wireguard-service-name interface))) + (modules '((shepherd service timer))) + (start #~(make-timer-constructor + #$(if (string? monitor-ips-interval) + #~(cron-string->calendar-event + #$monitor-ips-interval) + monitor-ips-interval) + (command '(#$(wireguard-monitoring-program config))) + #:wait-for-termination? #t)) + (stop #~(make-timer-destructor)) + (documentation "Monitor the Wireguard VPN tunnel.") + (actions (list shepherd-trigger-action))))) + + (cons (shepherd-service + (requirement '(networking user-processes)) (provision (list (wireguard-service-name interface))) (start #~(lambda _ - (invoke #$wg-quick "up" #$config))) + (invoke #$wg-quick "up" #$config-file))) (stop #~(lambda _ - (invoke #$wg-quick "down" #$config) + (invoke #$wg-quick "down" #$config-file) #f)) ;stopped! - (actions (list (shepherd-configuration-action config))) + (actions (list (shepherd-configuration-action config-file))) (auto-start? auto-start?) - (documentation "Run the Wireguard VPN tunnel")))))) - -(define (wireguard-monitoring-jobs config) - ;; Loosely based on WireGuard's own 'reresolve-dns.sh' shell script (see: - ;; https://raw.githubusercontent.com/WireGuard/wireguard-tools/ - ;; master/contrib/reresolve-dns/reresolve-dns.sh). - (match-record config - (interface monitor-ips? monitor-ips-interval peers) - (let ((host-names (endpoint-host-names peers))) - (if monitor-ips? - (if (null? host-names) - (begin - (warn "monitor-ips? is #t but no host name to monitor") - '()) - ;; The mcron monitor job may be a string or a list; ungexp strips - ;; one quote level, which must be added back when a list is - ;; provided. - (list - #~(job - (if (string? #$monitor-ips-interval) - #$monitor-ips-interval - '#$monitor-ips-interval) - #$(program-file - (format #f "wireguard-~a-monitoring" interface) - (with-imported-modules (source-module-closure - '((gnu services herd) - (guix build utils))) - #~(begin - (use-modules (gnu services herd) - (guix build utils) - (ice-9 popen) - (ice-9 match) - (ice-9 textual-ports) - (srfi srfi-1) - (srfi srfi-26)) - - (define (resolve-host name) - "Return the IP address resolved from NAME." - (let* ((ai (car (getaddrinfo name))) - (sa (addrinfo:addr ai))) - (inet-ntop (sockaddr:fam sa) - (sockaddr:addr sa)))) - - (define wg #$(file-append wireguard-tools "/bin/wg")) - - #$(procedure-source strip-port/maybe) - - (define service-name '#$(wireguard-service-name - interface)) - - (when (live-service-running - (current-service service-name)) - (let* ((pipe (open-pipe* OPEN_READ wg "show" - #$interface "endpoints")) - (lines (string-split (get-string-all pipe) - #\newline)) - ;; IPS is an association list mapping - ;; public keys to IP addresses. - (ips (map (match-lambda - ((public-key ip) - (cons public-key - (strip-port/maybe ip)))) - (map (cut string-split <> #\tab) - (remove string-null? - lines))))) - (close-pipe pipe) - (for-each - (match-lambda - ((key . host-name) - (let ((resolved-ip (resolve-host - (strip-port/maybe - host-name))) - (current-ip (assoc-ref ips key))) - (unless (string=? resolved-ip current-ip) - (format #t "resetting `~a' peer \ -endpoint to `~a' due to stale IP (`~a' instead of `~a')~%" - key host-name - current-ip resolved-ip) - (invoke wg "set" #$interface "peer" key - "endpoint" host-name))))) - '#$host-names))))))))) - '())))) ;monitor-ips? is #f + (documentation "Run the Wireguard VPN tunnel")) + (or (and=> monitoring-service list) + '()))))) (define wireguard-service-type (service-type (name 'wireguard) (extensions (list (service-extension shepherd-root-service-type - wireguard-shepherd-service) + wireguard-shepherd-services) (service-extension activation-service-type wireguard-activation) (service-extension profile-service-type (compose list - wireguard-configuration-wireguard)) - (service-extension mcron-service-type - wireguard-monitoring-jobs))) + wireguard-configuration-wireguard)))) (description "Set up Wireguard @acronym{VPN, Virtual Private Network} tunnels."))) From patchwork Sat Mar 15 21:37:14 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: 40222 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 9088D27BBE9; Sat, 15 Mar 2025 21:39:39 +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 4EF2827BBE2 for ; Sat, 15 Mar 2025 21:39:39 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDo-0004vO-CU; Sat, 15 Mar 2025 17:39:09 -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 1ttZDl-0004uD-7s for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:05 -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 1ttZDk-0002mg-T3 for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:04 -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:References:In-Reply-To:Date:From:To:Subject; bh=J86d6wlJyiG/xFreO7hCsXLBQMr+goEI4lMG2ZhkdWs=; b=feQgiyYQOjhqlX/jDxhTA83yVLH5JhTMwrTGjQsXXpsnCh5SNE8KSEuZlx1uifjQvhkUdsNfB2sBsErB/+NtAiBj0EI8UqsM6Uzd2o1oLBUl7Yyw3apjir1APSZq2nt8MUURBNM7q6nvEXvs7/7vE7o9SfsaINGIU4k8DobLlKnaAhXQppqE/MPUUJ3PTcJGQXzQyYKIeiV4HeZlRZUqVZdyffUob3CyoqGMJnK2SLZ5dPPq/6VqWLbDLWp/UUaoorXtBaW4VOvV6HEG6g38yKX63wkRJZehL0RiPC5LzAOUN83o6ng2bFxjF3tahfurJadg64d2zaW3MW5C0tM8MA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDk-0004VP-HT for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 08/16] tests: Make =?utf-8?q?=E2=80=98operating-?= =?utf-8?q?system-with-console-syslog=E2=80=99?= public. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207472117125 (code B ref 77041); Sat, 15 Mar 2025 21:39:04 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:41 +0000 Received: from localhost ([127.0.0.1]:43857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZDM-0004S5-RC for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55768) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCr-0004Nb-8q for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:09 -0400 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 1ttZCl-0002hZ-0E; Sat, 15 Mar 2025 17:38:03 -0400 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=J86d6wlJyiG/xFreO7hCsXLBQMr+goEI4lMG2ZhkdWs=; b=BDnAPrh+CeL7DutLNHnc h7YTN0V3C86uNtJt2eUu4jX6c3NAFbknPhvO9n0ByUWGt0fPTjYF8ETHRrYh7Su3GoxFMhlBoX5Kg ZGg56q8oj/LBK0kNkaprz0a4t0RrD42YWW+PP0UDtLtCs7QVtR/xSii2BX3EFetdatOjmD6gHx2Gh NN/opgh9xpSVff+34JKEoUucd83J1gr15p2qnOkiYeYL3C3BnluBy1Hq4RtIhdjZDWlnn1z1/AV2X Sc/OjNqxRfu2ZmlSVR1j/qloyBRbp2MsvIpojOWGb4cUFC8efyY/y1LZ9OZO3YyhdIK7CLn2o74Yo 9T80kys+Iak7bQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:14 +0100 Message-ID: <18ee01c05e82b666726f3709cad6fabafff9ae98.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/tests/install.scm (operating-system-with-console-syslog): Move to… * gnu/tests.scm (operating-system-with-console-syslog): … here. New procedure. Change-Id: I015e24525140365d09f22127d366107fdc9ca902 --- gnu/tests.scm | 21 +++++++++++++++++++++ gnu/tests/install.scm | 20 -------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/gnu/tests.scm b/gnu/tests.scm index 84298de448..abb7076208 100644 --- a/gnu/tests.scm +++ b/gnu/tests.scm @@ -53,6 +53,7 @@ (define-module (gnu tests) %simple-os simple-operating-system + operating-system-with-console-syslog system-test system-test? @@ -268,6 +269,26 @@ (define-syntax-rule (simple-operating-system user-services ...) (services (cons* user-services ... %base-services)))) +(define (operating-system-with-console-syslog os) + "Return OS with a system log service that writes to /dev/console." + (operating-system + (inherit os) + (services + (modify-services (operating-system-user-services os) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination + #~(lambda (message) + (let ((destinations ((default-message-destination-procedure) + message))) + (if (<= (system-log-message-priority message) + (system-log-priority info)) + (cons "/dev/console" destinations) + destinations)))))))))) + ;;; ;;; Tests. diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index a837637b18..8293296339 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -1784,26 +1784,6 @@ (define %test-xfs-root-os ;;; Installation through the graphical interface. ;;; -(define (operating-system-with-console-syslog os) - "Return OS with a syslog service that writes to /dev/console." - (operating-system - (inherit os) - (services - (modify-services (operating-system-user-services os) - (shepherd-system-log-service-type - config - => - (system-log-configuration - (inherit config) - (message-destination - #~(lambda (message) - (let ((destinations ((default-message-destination-procedure) - message))) - (if (<= (system-log-message-priority message) - (system-log-priority info)) - (cons "/dev/console" destinations) - destinations)))))))))) - (define %root-password "foo") (define* (gui-test-program marionette From patchwork Sat Mar 15 21:37:15 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: 40229 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 C9F5527BBEA; Sat, 15 Mar 2025 21:40:10 +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 1C6C027BBE2 for ; Sat, 15 Mar 2025 21:40:10 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZEl-0005dA-F4; Sat, 15 Mar 2025 17:40: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 1ttZEj-0005YJ-Ja for guix-patches@gnu.org; Sat, 15 Mar 2025 17:40:05 -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 1ttZEi-0002xD-61 for guix-patches@gnu.org; Sat, 15 Mar 2025 17:40:04 -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:References:In-Reply-To:Date:From:To:Subject; bh=ASZ5k0dIb4ZYdG0mMlz81k+mQPqwvtTufBnDwD19o1Y=; b=NvN7eQXL9ZTcLhNgAZAkPAeVCbP0z+4ARZZKzquaqOPqpH5lgjxsHyu5FNH1Dji9jIwHqmqGj/DPn1pKCLVv1J+8fT2aCoh1vH79GByeExV5qMEJ1ZRzNdmK9kBh6Zl5cDAbd/wSnl6aBurv70cDDx7EvmtWlrBwt4pSIt+ckx0FTxCMb/pAKfKbCCnhBL07kI2vWsKs3Gt2Gx7Q3+J+Q9h86goBzlmLJMrIvldCVwB00kyWLkKH/HzZpos5m1VkXwWfEfC0vdHvg1441tYQN61mET2q+QM0QN6ovNu0HJB9CWzHWlMAutqe/NqoSYgidA/yERWtk2eBk2FhcdR+AQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZEh-0004cu-UT for guix-patches@gnu.org; Sat, 15 Mar 2025 17:40:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 09/16] tests: ganeti: Remove unnecessary =?utf-8?b?4oCYYmVnaW7igJku?= Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:40:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207476117429 (code B ref 77041); Sat, 15 Mar 2025 21:40:03 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:39:21 +0000 Received: from localhost ([127.0.0.1]:43880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZE0-0004X2-P4 for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:39:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55776) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCr-0004Nc-HG for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:09 -0400 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 1ttZCm-0002hn-6D; Sat, 15 Mar 2025 17:38:04 -0400 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=ASZ5k0dIb4ZYdG0mMlz81k+mQPqwvtTufBnDwD19o1Y=; b=W4E4tPIT86Tlj06XD/ty F4nofEvzVztQGJ3egSSYD36ctNp32Cdn/vSBOOZQeAjiP96MpWlqx6Rc7CHHXUN4mbvt7heVuqAVd R6s2XHL7eW58rt7HNlZCnCeNP4FrECuDr2fvQFwOuIayQvnbGsLlV9oAbeHw9BosS//Hnm6OrDB/K evf7eUzQdNQzxbYjCLzqQVHdehAkSj+teyw2zX9yMVSG6pHmTwzvh50CTaXHX2/p1qiJqmX2CWzs+ wUUOr+6xouNG81DG5X96pn8vqzIzTU4XCICH2jZhAjDJcF8MSZd60dW3m95MB9jA+kP9fEpbO8K0R uJhvWh/RvqYtKA==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:15 +0100 Message-ID: <05bc1b0ed65b4456d6e563373deb485e15d7c22d.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/tests/ganeti.scm (run-ganeti-test): Remove ‘begin’ where unnecessary. Change-Id: I3a36fffdc797c9187b5ffa406f7a06985f18d29c --- gnu/tests/ganeti.scm | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index 29eb354044..ce55c8e04f 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -154,9 +154,8 @@ (define* (run-ganeti-test hypervisor #:key (test-eq "watcher pause" 0 (marionette-eval - '(begin - (system* #$(file-append ganeti "/sbin/gnt-cluster") - "watcher" "pause" "1h")) + '(system* #$(file-append ganeti "/sbin/gnt-cluster") + "watcher" "pause" "1h") marionette)) (test-assert "force-start wconfd" @@ -174,8 +173,7 @@ (define* (run-ganeti-test hypervisor #:key (test-eq "gnt-cluster verify 1" 0 (marionette-eval - '(begin - (system* #$(file-append ganeti "/sbin/gnt-cluster") "verify")) + '(system* #$(file-append ganeti "/sbin/gnt-cluster") "verify") marionette)) ;; Try stopping and starting daemons with daemon-util like @@ -183,33 +181,29 @@ (define* (run-ganeti-test hypervisor #:key (test-eq "daemon-util stop-all" 0 (marionette-eval - '(begin - (system* #$(file-append ganeti "/lib/ganeti/daemon-util") - "stop-all")) + '(system* #$(file-append ganeti "/lib/ganeti/daemon-util") + "stop-all") marionette)) (test-eq "daemon-util start-all" 0 (marionette-eval - '(begin - (system* #$(file-append ganeti "/lib/ganeti/daemon-util") - "start-all")) + '(system* #$(file-append ganeti "/lib/ganeti/daemon-util") + "start-all") marionette)) ;; Check that the cluster is still healthy after the daemon restarts. (test-eq "gnt-cluster verify 2" 0 (marionette-eval - '(begin - (system* #$(file-append ganeti "/sbin/gnt-cluster") "verify")) + '(system* #$(file-append ganeti "/sbin/gnt-cluster") "verify") marionette)) (test-eq "watcher continue" 0 (marionette-eval - '(begin - (system* #$(file-append ganeti "/sbin/gnt-cluster") - "watcher" "continue")) + '(system* #$(file-append ganeti "/sbin/gnt-cluster") + "watcher" "continue") marionette)) ;; Try accessing the RAPI. @@ -244,9 +238,8 @@ (define* (run-ganeti-test hypervisor #:key (test-eq "gnt-cluster destroy" 0 (marionette-eval - '(begin - (system* #$(file-append ganeti "/sbin/gnt-cluster") - "destroy" "--yes-do-it")) + '(system* #$(file-append ganeti "/sbin/gnt-cluster") + "destroy" "--yes-do-it") marionette)) (test-end)))) From patchwork Sat Mar 15 21:37:16 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: 40221 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 4A32D27BBEA; Sat, 15 Mar 2025 21:39:38 +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 C3FE827BBE2 for ; Sat, 15 Mar 2025 21:39:37 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDs-0004xo-7A; Sat, 15 Mar 2025 17:39:12 -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 1ttZDl-0004un-RZ for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:06 -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 1ttZDl-0002mo-F5 for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:05 -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:References:In-Reply-To:Date:From:To:Subject; bh=S+IKs4pr1pR4iSgRs+HL5omwv7CnO337JSiYV4uwBkc=; b=Ci6Mg6IeNWm/T9hMCocLFb2ZewTQLvpv6DPLx57wHcuayzYJFLQ3zZqA/SH0PgU4y4ZxEW7E+yMxIFBFl3Zx6HAAobgT03Lby9/hoU4gcEC+KnqhV7gYjvXpBauoHcsJX0ATRvjxAukrhR/eSX82O0j4Op/cHVC/caGkt0pyeo3m2KY0CpBOA448WkR5DTwuc044XLjCBpaPdACC4+B+2ZLEWvLlp8zVl313/vgIlz8H4VtnX63ekKGwis4tepchuYfoMpEkFkxqmENdyVqFngGj0XygJbabZ+TojFN2MDBAvzIi16dkbxkDYMgf9zSYR77pGCcjSmR52dBS5Ed0kQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDl-0004VW-0I for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 10/16] tests: ganeti: Write system log to /dev/console. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207473717237 (code B ref 77041); Sat, 15 Mar 2025 21:39:04 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:57 +0000 Received: from localhost ([127.0.0.1]:43859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZDc-0004Tt-S5 for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55780) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCs-0004Ng-TG for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:11 -0400 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 1ttZCn-0002i3-GA; Sat, 15 Mar 2025 17:38:05 -0400 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=S+IKs4pr1pR4iSgRs+HL5omwv7CnO337JSiYV4uwBkc=; b=nU1lxllXdqPZCeapYGCp Ukr2+InJ3/jaZJDPiflDfa6grLCOeZG8DVYdZYOukG+mQRj5vZRbQqiRgjCGdx+0cknhw8aPrTvR3 2F3jh8jw7mElFQkO8q1t+U5o6taOQxFDOsgd/efAtlZsNCGquLNbGMqNSJ+1MsHoDSVWI7glgeMnY X0QR5m/N1C5PjW6iZZ2cHivGkzw3iy2Ho8uRK4vqs5MQ8i2Jupf8xXccOJ74m4n8quyFQMGbdnQgX yECMYXQLp83L4lKb/DCY6zq1SYUqqDXL09OpmW9m5oW7ly4Vpu0rEqQxI+atOxujfKS0R7xFuQ36W FmVLo9tGUe4G2w==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:16 +0100 Message-ID: <20e0f3fd05f4ec2a2b62cd25c050b72ac98dba38.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/tests/ganeti.scm (%ganeti-os): Wrap in ‘operating-system-with-console-syslog’. Change-Id: Ie86ad640ad6a7c154f5768ac4250acdd0e8940af --- gnu/tests/ganeti.scm | 87 ++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index ce55c8e04f..42ed58d977 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -33,54 +33,55 @@ (define-module (gnu tests ganeti) #:export (%test-ganeti-kvm %test-ganeti-lxc)) (define %ganeti-os - (operating-system - (host-name "gnt1") - (timezone "Etc/UTC") - (locale "en_US.UTF-8") + (operating-system-with-console-syslog + (operating-system + (host-name "gnt1") + (timezone "Etc/UTC") + (locale "en_US.UTF-8") - (bootloader (bootloader-configuration - (bootloader grub-bootloader) - (targets '("/dev/vda")))) - (file-systems (cons (file-system - (device (file-system-label "my-root")) - (mount-point "/") - (type "ext4")) - %base-file-systems)) - (firmware '()) + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (targets '("/dev/vda")))) + (file-systems (cons (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (firmware '()) - (packages (append (list ganeti-instance-debootstrap ganeti-instance-guix) - %base-packages)) + (packages (append (list ganeti-instance-debootstrap ganeti-instance-guix) + %base-packages)) - ;; The hosts file must contain a nonlocal IP for host-name. - (essential-services - (modify-services (operating-system-default-essential-services this-operating-system) - (hosts-service-type config => (list - (host "127.0.0.1" "localhost") - (host "::1" "localhost"))))) - (services - (append (list (service static-networking-service-type - (list %qemu-static-networking)) - (service openssh-service-type - (openssh-configuration - (permit-root-login 'prohibit-password))) + ;; The hosts file must contain a nonlocal IP for host-name. + (essential-services + (modify-services (operating-system-default-essential-services this-operating-system) + (hosts-service-type config => (list + (host "127.0.0.1" "localhost") + (host "::1" "localhost"))))) + (services + (append (list (service static-networking-service-type + (list %qemu-static-networking)) + (service openssh-service-type + (openssh-configuration + (permit-root-login 'prohibit-password))) - ;; In addition, the cluster name must resolve to an IP address that - ;; is not currently provisioned. - (simple-service 'ganeti-host-entries hosts-service-type - (list - (host "10.0.2.15" "gnt1.example.com" '("gnt1")) - (host "192.168.254.254" "ganeti.example.com"))) + ;; In addition, the cluster name must resolve to an IP address that + ;; is not currently provisioned. + (simple-service 'ganeti-host-entries hosts-service-type + (list + (host "10.0.2.15" "gnt1.example.com" '("gnt1")) + (host "192.168.254.254" "ganeti.example.com"))) - (service ganeti-service-type - (ganeti-configuration - (file-storage-paths '("/srv/ganeti/file-storage")) - (rapi-configuration - (ganeti-rapi-configuration - ;; Disable TLS so we can test the RAPI without - ;; pulling in GnuTLS. - (ssl? #f))) - (os %default-ganeti-os)))) - %base-services)))) + (service ganeti-service-type + (ganeti-configuration + (file-storage-paths '("/srv/ganeti/file-storage")) + (rapi-configuration + (ganeti-rapi-configuration + ;; Disable TLS so we can test the RAPI without + ;; pulling in GnuTLS. + (ssl? #f))) + (os %default-ganeti-os)))) + %base-services))))) (define* (run-ganeti-test hypervisor #:key (master-netdev "eth0") From patchwork Sat Mar 15 21:37:17 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: 40223 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 4DA9527BBEA; Sat, 15 Mar 2025 21:39:47 +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 22B6627BBE2 for ; Sat, 15 Mar 2025 21:39:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDq-0004we-6W; Sat, 15 Mar 2025 17:39:10 -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 1ttZDm-0004ur-5x for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:06 -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 1ttZDl-0002n0-RG for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:05 -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:References:In-Reply-To:Date:From:To:Subject; bh=f578GIeB3CRy8TTnsIafTl4hBoKgVU+hOI0dI2zxvuE=; b=Zt6A4tKdtUwqK9Wjilm6HpuqKZUiqluIKqvjEYTq5YKcFnA5E/rtHK09ahgf0Ib6ce2mvxgTK3CXK3kHMY7HaYFMgL7+KUHAM53GunvgMxK9XYDYSme2duPYTMaMwlzWUDdtx5g7BI02cyfpa1bywaTeo7mkcurg4Se4sBj7pmM90ySm4m6/YIsUZwqliyuO9os4/bd8j/r2Iuc8imGJAW0jUpXADFJ0H/ocGdU0P2ZoL2MXFl3LOJsxypLZo39aApscnWVyGtBYld/Up94vgDEl44IZSYuJg8crrB4Wgv+CQqSbWDkpaRqTupnEsr0W0zALDG/6/65kHKYNyOZJ3w==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDl-0004Vg-JD for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 11/16] tests: ganeti: Increase VM memory size. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207473817245 (code B ref 77041); Sat, 15 Mar 2025 21:39:05 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:58 +0000 Received: from localhost ([127.0.0.1]:43861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZDd-0004Ty-GF for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55794) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCu-0004Nl-OG for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:14 -0400 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 1ttZCo-0002iC-BA; Sat, 15 Mar 2025 17:38:06 -0400 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=f578GIeB3CRy8TTnsIafTl4hBoKgVU+hOI0dI2zxvuE=; b=H6b9iBkxxyl8EG/8h6wD c0FSpERFrF7U7ZXOBDhbazROWpNIxz9Ze93dyKSQvKeTElhC7zYM7ugZE1SGl7/Jv4kzp2+tVMIQ5 Cpuc3aBpzC717VKuDy6GcUBK+bDj+TkTC+xm1zXsl/lR2C4/ZSFQ/v74h0PbNc9tpdKBGsD/pH4LS 6erm7b9rfpOY51XB6IlAUVgvWUK1XbQaXhbrUQhvKJjLK6Pa7oQAzPe7WRrJLVr3l1ZpCX0qwt6BA CSttI7hMVEujU/J+EC/iLjs5OAr8JA87alD5FUbwr46mEoSJiLqiz85AN8WnXXglNJ6c/DSiL6xA3 2kl6cKlt/nTiqw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:17 +0100 Message-ID: <56f9dea90aa68cb053ae44d598b92c47144b973f.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/tests/ganeti.scm (run-ganeti-test): Pass ‘-m 1024’ to ‘make-marionette’. Change-Id: I82c8a0eb37c16079f1affe793afc0d8a773c62c8 --- gnu/tests/ganeti.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index 42ed58d977..140950776e 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -117,7 +117,7 @@ (define* (run-ganeti-test hypervisor #:key (gnu build marionette)) (define marionette - (make-marionette (list #$vm))) + (make-marionette (list #$vm "-m" "1024"))) (test-runner-current (system-test-runner #$output)) (test-begin "ganeti") From patchwork Sat Mar 15 21:37:18 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: 40227 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 C1CF727BBEA; Sat, 15 Mar 2025 21:39:55 +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 8822F27BBE9 for ; Sat, 15 Mar 2025 21:39:55 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDr-0004xf-A3; Sat, 15 Mar 2025 17:39:11 -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 1ttZDm-0004v7-US for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:06 -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 1ttZDm-0002n7-Ew for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:06 -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:References:In-Reply-To:Date:From:To:Subject; bh=KZ7oLLkXmt5hqfPyIHODxWcEeiUl8Vy7AV/4viyIeEc=; b=hSYzFvYKfY8bkRYb+4VCN/okxSjMyvuMj7dIEImbp4cR4Iytx6FKloX3LEg5emBXE8Mz/8a9TeE8JZSp7Vh/CQy0FAILsj7Xpob709sJPyK5+JHH8m6n6RuzhVCT9r9h4e7ALjhLVz/UgC3cxd0xyMDL4KMHNf1aNUQUCV3zPQ3hwIAZ0UHIbbaZ12tRL+QD9VycjeIPrciWIJj7M9mnn93ZH+YpkUXeNpnNO3wVfyH/1d5TfY16u1nkUpPNz/lMq2HKsCNON3Vfqx9wnGqbmJ8///JL8Y9ttfwNhmj/UBggIavHSTTMtotPAraAa38Dygoe169II3V064VdNr7yeA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDm-0004Vn-2C for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 12/16] services: ganeti: Update to Shepherd 1.0 interface. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207473817253 (code B ref 77041); Sat, 15 Mar 2025 21:39:06 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:58 +0000 Received: from localhost ([127.0.0.1]:43863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZDd-0004U6-Vq for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55816) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCv-0004Nz-TL for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:19 -0400 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 1ttZCp-0002iK-Dg; Sat, 15 Mar 2025 17:38:07 -0400 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=KZ7oLLkXmt5hqfPyIHODxWcEeiUl8Vy7AV/4viyIeEc=; b=IeI5z1i6FlXXm3qWypwZ 4o9M4KSxIBSVdsSXkJ330dPIMgbImcLaVb1II/ztBt008E0K+V/TYdZlo039X8rIwxkbuwvdrGf0G wmYEFcYYvxtAUNO9VhBH99hLWlwy1c9OLhyyjhyjigi1SSPgaZdJlkx0nfcd3pc3ccH16FMZYIOsM fnzyy0JszDWiuolZlQfbnTnerCrwFSHBANIIPrZCHzsDOWHmk4xO41LFj5BhOD/0s5nkT3GHL4IwM N5TOgunikF7bk605zkP1dyJBMjTkfyUfz0CrWrWl8N5Efpl5HKizRc4Yvs3ZTf08uKCKwrA+bBNdl 10JaK503ZE4LqA==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:18 +0100 Message-ID: <8719086cc46a85760d78bf1515b2b0684462bcb9.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/ganeti.scm (shepherd-wconfd-force-start-action)[procedure]: Use ‘enable-service’ and ‘perform-service-action’ instead of ‘action’, which was deprecated in 0.10.x and replaced in 1.0. Change-Id: I2ba7d973b95f17f6ce093185fec7b246cf427be9 --- gnu/services/ganeti.scm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/gnu/services/ganeti.scm b/gnu/services/ganeti.scm index ee72946c88..f905ab8395 100644 --- a/gnu/services/ganeti.scm +++ b/gnu/services/ganeti.scm @@ -329,18 +329,17 @@ (define shepherd-wconfd-force-start-action "Forcefully start wconfd even on non-master nodes (dangerous!).") (procedure #~(lambda _ (format #t "Forcefully starting the wconfd daemon...~%") - (action 'ganeti-wconfd 'enable) - (dynamic-wind - (lambda () - (false-if-exception - (call-with-output-file #$%wconfd-force-node-hint - (lambda (port) - (const #t))))) - (lambda () - (action 'ganeti-wconfd 'restart)) + (enable-service (lookup-service 'ganeti-wconfd)) + (call-with-output-file #$%wconfd-force-node-hint + (const #t)) + (catch #t (lambda () + (perform-service-action (lookup-service 'ganeti-wconfd) + 'restart) + (delete-file #$%wconfd-force-node-hint)) + (lambda _ (delete-file #$%wconfd-force-node-hint))) - #t)))) + #t)))) (define ganeti-wconfd-service (match-lambda From patchwork Sat Mar 15 21:37:19 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: 40228 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 420E927BBEA; Sat, 15 Mar 2025 21:40:09 +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 88FF827BBE2 for ; Sat, 15 Mar 2025 21:40:08 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZEk-0005aT-3y; Sat, 15 Mar 2025 17:40: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 1ttZEi-0005Yq-UN for guix-patches@gnu.org; Sat, 15 Mar 2025 17:40:05 -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 1ttZEi-00030k-KQ; Sat, 15 Mar 2025 17:40:04 -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:References:In-Reply-To:Date:From:To:Subject; bh=hfTt1YgA2yjcU7Sbmn2lFztd4qGuDA7xv+W30rWckgQ=; b=Um6vooRSUQ9vamkydsIDUNU3UFk8O6fR31glg+iHiim5809W+eHeEzX0CzFq678/ecFjad/htd3dShNl1quT6D29f+4hnbcw+Glag9tGJ4OH4tcQJWEf5jNhCJCbWuDUsk2LoFxX9qOJ1URjObiqhoU84muo0Hln1JFOifUsZECnLa+8tKB4vgGajorZqKxsazDtszTsOOw7Grxc6DMTaFuDKuhAoX6IdSV4bu/1B0BeHNAcwSc9xo9IFni+FEWatSuJZiJQuyzjvp88z9m7hDRQGkbrjajueeJ/os4G0/5ttWJRwOk9X20kYODbA10E+TDxDuvFqAcsPd989kExwg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZEi-0004d2-EW; Sat, 15 Mar 2025 17:40:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 13/16] services: ganeti: Produce Shepherd timers instead of mcron jobs. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:40:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207476217437 (code B ref 77041); Sat, 15 Mar 2025 21:40:04 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:39:22 +0000 Received: from localhost ([127.0.0.1]:43882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZE1-0004X4-92 for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:39:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55800) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZCv-0004Ny-RN for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:21 -0400 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 1ttZCq-0002iT-Cs; Sat, 15 Mar 2025 17:38:08 -0400 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=hfTt1YgA2yjcU7Sbmn2lFztd4qGuDA7xv+W30rWckgQ=; b=qsfihLuRmWtXWVXD8ya3 2MfpJlHIUxiV6kBY6xasNdybKl4BKkXjhzV+X8AApg6QGowiH6bURVLYO3AhNskdPRPWU5AmtcZzP ATOshMD7W5qcPdAignAGSoOcdrW0U8xR+TrlxZUqsz9XG81NOukCnpcPLNuVWKOYO5gM2NE9bxf7b 3l1Ocfyw2x2HSi/hkigTTJ0AmRqY8GEk0vCmw5T7ro1eeYqufb+nnGHOL7Dx5AQhFX+noJ5iYNCIH 1SZqfUB/r50vcuIxpILsT2Q5GV9FdmQ91ja21PLfvVMdL++4ZIM12c6uB564gBuQQu5HN/tFqaY5W 6eRI0HdZhN1i1w==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:19 +0100 Message-ID: <062c86dcff350447488f600a445202a35915ad10.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/ganeti.scm ()[schedule]: Change default value to a cron string. (ganeti-timer): New procedure. (ganeti-watcher-jobs): Rename to… (ganeti-watcher-service): … this. Return Shepherd services. (ganeti-watcher-service-type)[extensions]: Adjust accordingly. (ganeti-cleaner-jobs): Rename to… (ganeti-cleaner-service): … this. Return Shepherd services. (ganeti-cleaner-service-type)[extensions]: Adjust accordingly. (ganeti-shepherd-services): Include the watcher and cleaner services. (ganeti-mcron-jobs): Remove. (ganeti-service-type)[extensions]: Adjust accordingly. * doc/guix.texi (Virtualization Services): Update ‘schedule’ documentation. Change-Id: Id209a3c50271203dc7190c4c6d0c0ffdf6c10875 --- doc/guix.texi | 7 ++- gnu/services/ganeti.scm | 116 +++++++++++++++++++--------------------- 2 files changed, 59 insertions(+), 64 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 7f3a7ca82a..35999db9b0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -39775,8 +39775,11 @@ Virtualization Services @item @code{ganeti} (default: @code{ganeti}) The @code{ganeti} package to use for this service. -@item @code{schedule} (default: @code{'(next-second-from (next-minute (range 0 60 5)))}) -How often to run the script. The default is every five minutes. +@item @code{schedule} (default: @code{"*/5 * * * *"}) +When to run the script, expressed either as a string in traditional cron +syntax or as a gexp representing a Shepherd calendar event +(@pxref{Timers,,, shepherd, The GNU Shepherd Manual}). The default is +every five minutes. @item @code{rapi-ip} (default: @code{#f}) This option needs to be specified only if the RAPI daemon is configured to use diff --git a/gnu/services/ganeti.scm b/gnu/services/ganeti.scm index f905ab8395..9cab6c110a 100644 --- a/gnu/services/ganeti.scm +++ b/gnu/services/ganeti.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2022 Marius Bakke +;;; Copyright © 2025 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,14 +20,11 @@ (define-module (gnu services ganeti) #:use-module (gnu packages virtualization) #:use-module (gnu services) - #:use-module (gnu services mcron) #:use-module (gnu services shepherd) #:use-module (guix gexp) #:use-module (guix records) - #:use-module (srfi srfi-1) #:use-module (ice-9 match) - #:export (ganeti-noded-configuration ganeti-noded-configuration? ganeti-noded-configuration-ganeti @@ -644,9 +642,8 @@ (define-record-type* (ganeti ganeti-watcher-configuration-ganeti ;file-like (default ganeti)) (schedule ganeti-watcher-configuration-schedule ;list | string - (default '(next-second-from - ;; Run every five minutes. - (next-minute (range 0 60 5))))) + ;; Run every 5 minutes. + (default "*/5 * * * *")) (rapi-ip ganeti-watcher-configuration-rapi-ip ;#f | string (default #f)) (job-age ganeti-watcher-configuration-job-age ;integer @@ -660,36 +657,47 @@ (define ganeti-watcher-command (match-lambda (($ ganeti _ rapi-ip job-age verify-disks? debug?) - #~(lambda () - (system* #$(file-append ganeti "/sbin/ganeti-watcher") - #$@(if rapi-ip - #~((string-append "--rapi-ip=" #$rapi-ip)) - #~()) - #$(string-append "--job-age=" (number->string job-age)) - #$@(if verify-disks? - #~() - #~("--no-verify-disks")) - #$@(if debug? - #~("--debug") - #~())))))) + #~(#$(file-append ganeti "/sbin/ganeti-watcher") + #$@(if rapi-ip + #~((string-append "--rapi-ip=" #$rapi-ip)) + #~()) + #$(string-append "--job-age=" (number->string job-age)) + #$@(if verify-disks? + #~() + #~("--no-verify-disks")) + #$@(if debug? + #~("--debug") + #~()))))) -(define (ganeti-watcher-jobs config) +(define (ganeti-timer name schedule command) + "Return a Shepherd timer providing NAME and running COMMAND, a list-valued +gexp." + (shepherd-service + (provision (list name)) + (requirement '(user-processes)) + (modules '((shepherd service timer))) + (start #~(make-timer-constructor + #$(if (string? schedule) + #~(cron-string->calendar-event #$schedule) + schedule) + (command '(#$@command)) + #:wait-for-termination? #t)) + (stop #~(make-timer-destructor)) + (documentation "Periodically run a Ganeti maintenance job.") + (actions (list shepherd-trigger-action)))) + +(define (ganeti-watcher-service config) (match config (($ _ schedule) - (list - #~(job #$@(match schedule - ((? string?) - #~(#$schedule)) - ((? list?) - #~('#$schedule))) - #$(ganeti-watcher-command config) - "ganeti-watcher"))))) + (list (ganeti-timer 'ganeti-watcher + schedule + (ganeti-watcher-command config)))))) (define ganeti-watcher-service-type (service-type (name 'ganeti-watcher) (extensions - (list (service-extension mcron-service-type - ganeti-watcher-jobs))) + (list (service-extension shepherd-root-service-type + ganeti-watcher-service))) (default-value (ganeti-watcher-configuration)) (description "@command{ganeti-watcher} is a periodically run script that @@ -714,34 +722,23 @@ (define-record-type* ;; Run the node cleaner at 02:45 every day. (default "45 2 * * *"))) -(define ganeti-cleaner-jobs +(define ganeti-cleaner-service (match-lambda (($ ganeti master-schedule node-schedule) - (list - #~(job #$@(match master-schedule - ((? string?) - #~(#$master-schedule)) - ((? list?) - #~('#$master-schedule))) - (lambda () - (system* #$(file-append ganeti "/sbin/ganeti-cleaner") - "master")) - "ganeti master cleaner") - #~(job #$@(match node-schedule - ((? string?) - #~(#$node-schedule)) - ((? list?) - #~('#$node-schedule))) - (lambda () - (system* #$(file-append ganeti "/sbin/ganeti-cleaner") - "node")) - "ganeti node cleaner"))))) + (list (ganeti-timer 'ganeti-master-cleaner + master-schedule + #~(#$(file-append ganeti "/sbin/ganeti-cleaner") + "master")) + (ganeti-timer 'ganeti-node-cleaner + node-schedule + #~(#$(file-append ganeti "/sbin/ganeti-cleaner") + "node")))))) (define ganeti-cleaner-service-type (service-type (name 'ganeti-cleaner) (extensions - (list (service-extension mcron-service-type - ganeti-cleaner-jobs))) + (list (service-extension shepherd-root-service-type + ganeti-cleaner-service))) (default-value (ganeti-cleaner-configuration)) (description "@command{ganeti-cleaner} is a script that removes old files @@ -804,7 +801,8 @@ (define (ganeti-activation config) (define ganeti-shepherd-services (match-lambda - (($ _ noded confd wconfd luxid rapi kvmd mond metad) + (($ _ noded confd wconfd luxid rapi kvmd mond metad + watcher cleaner) (append (ganeti-noded-service noded) (ganeti-confd-service confd) (ganeti-wconfd-service wconfd) @@ -812,13 +810,9 @@ (define ganeti-shepherd-services (ganeti-rapi-service rapi) (ganeti-kvmd-service kvmd) (ganeti-mond-service mond) - (ganeti-metad-service metad))))) - -(define ganeti-mcron-jobs - (match-lambda - (($ _ _ _ _ _ _ _ _ _ watcher cleaner) - (append (ganeti-watcher-jobs watcher) - (ganeti-cleaner-jobs cleaner))))) + (ganeti-metad-service metad) + (ganeti-watcher-service watcher) + (ganeti-cleaner-service cleaner))))) (define-record-type* ganeti-os make-ganeti-os ganeti-os? @@ -1122,9 +1116,7 @@ (define ganeti-service-type (service-extension etc-service-type ganeti-etc-service) (service-extension profile-service-type - (compose list ganeti-configuration-ganeti)) - (service-extension mcron-service-type - ganeti-mcron-jobs))) + (compose list ganeti-configuration-ganeti)))) (default-value (ganeti-configuration (os %default-ganeti-os))) (description "Ganeti is a family of services that are designed to run From patchwork Sat Mar 15 21:37: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: 40220 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 9D4C127BBE9; Sat, 15 Mar 2025 21:39:28 +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 7BFA727BBE2 for ; Sat, 15 Mar 2025 21:39:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZDv-0004zo-V1; Sat, 15 Mar 2025 17:39:16 -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 1ttZDn-0004vE-9g for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:07 -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 1ttZDm-0002nB-Ol for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:06 -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:References:In-Reply-To:Date:From:To:Subject; bh=kGF3ySIRxAtAsDKeidexjYNbV1CuYNkwsh7fxqP0cqs=; b=rFAxZ9d62BuQpPReLFgHXggEjJxl2kEigEbvH9XDaCRKD7oD8INSTYb/DWRK+tLw0aOuW/S7+mSM8O0v6M38DZ0AwuSMy32ORaQXyNT7aKzIQq0BPh69b9OgEsD6Q5TcRzPjpP2iPZ/sgsclKze8ZbPSit1LuVzvDptsXikP6LwzGdq/iE1DkCCKJcptVcmBg1ZHkZ5j/ddZOBkPSaem6yfGsXmF12tv/WmptlmWBCMjUZ1xcXh5lk/o07exwUFvFiuTuShbORyeRASgh6mDZ+//WbzmHrrqh/Kc5hY8VBV35gIzsZECr+xQn1Z0Y50d9iPnSpNnsaq0kcbRC6PKVQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZDm-0004Vv-IB for guix-patches@gnu.org; Sat, 15 Mar 2025 17:39:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 14/16] services: virtual-build-machine: Turn GC job into a Shepherd timer. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:39:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207473917260 (code B ref 77041); Sat, 15 Mar 2025 21:39:06 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:38:59 +0000 Received: from localhost ([127.0.0.1]:43865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZDe-0004UD-Cp for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50186) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZD0-0004Od-49 for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:20 -0400 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 1ttZCu-0002io-HN; Sat, 15 Mar 2025 17:38:12 -0400 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=kGF3ySIRxAtAsDKeidexjYNbV1CuYNkwsh7fxqP0cqs=; b=HcI/J+sROmGCnhRGUAsA QeHa1wB6/90UWzE254XF/VgYRrNPhm7HchtIba7kHu+iwYMScGuzKrTq/2Y8e58cQf4yjuM9ygSdg I6YxapXWZYlEwlA/icYBSCbMLD8uaJCnXtarNAR1+2pwnWIjiHSkb2jLNjKEh6989kMbMbQ4pZpb7 v/y/20JJznCtVVk3b8pWLh7/4RMKt0NAoXqZ21T9QuERZV4K9mMCZ6fdC/tNohEEfDG9+FBpJIKSk zaI5tsl/nOAIng6kHDfStTsMv4v7c2aBcukFAySp5wOpOZOSmmaf0LiAiomhc3cA2WJQM7mi6JafI d7t3z3SIBg7Gqw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:20 +0100 Message-ID: <134eeae955e072d41a212d5b0a41c43fed4edd4b.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/virtualization.scm (gc-service-type): New variable. (%virtual-build-machine-operating-system): Use instead of extending ‘mcron-service-type’. Change-Id: I56d7f9293f582269e5a34d91bf4f3edddfa844e0 --- gnu/services/virtualization.scm | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index 796b9bf86f..171915d62d 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -40,7 +40,6 @@ (define-module (gnu services virtualization) #:use-module (gnu services base) #:use-module (gnu services configuration) #:use-module (gnu services dbus) - #:use-module (gnu services mcron) #:use-module (gnu services shepherd) #:use-module (gnu services ssh) #:use-module (gnu services) @@ -1304,6 +1303,23 @@ (define %system-log-message-destination (else '("/dev/console"))))) +(define gc-service-type ;TODO: Factorize. + (shepherd-service-type + 'garbage-collection + (lambda _ + (shepherd-service + (provision '(gc)) + (requirement '(user-processes guix-daemon)) + (start #~(make-timer-constructor + (calendar-event #:minutes '(12)) + (command + '("/run/current-system/profile/bin/guix" "gc" "-F2G")) + #:wait-for-termination? #t)) + (stop #~(make-timer-constructor)) + (actions (list shepherd-trigger-action)))) + #t + (description "Periodically collect garbage."))) + (define %virtual-build-machine-operating-system (operating-system (host-name "build-machine") @@ -1336,9 +1352,7 @@ (define %virtual-build-machine-operating-system (openssh openssh-sans-x))) ;; Run GC once per hour. - (simple-service 'perdiodic-gc mcron-service-type - (list #~(job "12 * * * *" - "guix gc -F 2G"))) + (service gc-service-type) (modify-services %base-services ;; By default, the secret service introduces a From patchwork Sat Mar 15 21:37: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: 40231 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 EC22F27BBE9; Sat, 15 Mar 2025 21:40:25 +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 38FBD27BBE2 for ; Sat, 15 Mar 2025 21:40:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZEs-0005n7-SN; Sat, 15 Mar 2025 17:40:14 -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 1ttZEq-0005kz-VG for guix-patches@gnu.org; Sat, 15 Mar 2025 17:40:13 -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 1ttZEp-000395-IQ; Sat, 15 Mar 2025 17:40:11 -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:References:In-Reply-To:Date:From:To:Subject; bh=6IMx1UEc5LvSLUjN4SExoS+dfI7V76NXd5h1fVii0BY=; b=D/h1iHMKtq8KNl7hfxQHlLrIkrUe9GaXP7GtFOQlv0ggxONZMNjIzfcKBMO3irQ4HeKemoBw3c8i8Y7gC14VW1DuG5DUHLJbbhw0ZP0rIHU3mREqfHR+3QR3jR5QqFeMex+E3vZNp1q5z8cse8c4LYn3EkeDAH0E6Jb2pgO8OsaC+ONtGtBiTwgNCBCGkRMOfeQSU+8XX56UWNEbZrimHrA4nxTKlu1rqzlBe3X6yhfd0iU8waexVCr/VlTunQmvtlpKxbUns9dcdmEbF6Q2s/af6Y6CfBRisathd78eXuYLdUV+H2VVcHTS5dUugC8F8J/131RoHjTSs2sub8lWXA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZEk-0004dm-2I; Sat, 15 Mar 2025 17:40:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 15/16] services: mcron: Deprecate. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, maxim.cournoyer@gmail.com, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:40:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer , Tanguy Le Carrour X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer , Tanguy Le Carrour Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207476317456 (code B ref 77041); Sat, 15 Mar 2025 21:40:05 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:39:23 +0000 Received: from localhost ([127.0.0.1]:43886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZE2-0004XL-Iq for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:39:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50202) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZD3-0004PJ-0e for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:23 -0400 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 1ttZCx-0002j0-Ar; Sat, 15 Mar 2025 17:38:15 -0400 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=6IMx1UEc5LvSLUjN4SExoS+dfI7V76NXd5h1fVii0BY=; b=QMeZnTiaBPvqwoecCYgs W0n+0Z143/b742jKCrYW29/ZMUop5OeP4Ov0zUqb8oGAJwSiaPUwa3KEjlZDnDelM1lpEDLWEgQri QygHuxB5sdokAkCTLJe4oD2p1z9vYlqO6P7ZQfAIkQQnL814BMcHpmCuNk77JO2t3ra+22nrZPQXl RjeoatE6fVLfdLULpG5xg7ih4APMs6ieVq21bpcRA9yYrEgtCPiNHp+nWdOKv0taLzCUtOCSzNS+K Tm5w+drkJcQoiJSunF/8J/nNrWYVoUdAvAD+F9gTl5S5gB5OxansvoXU0J5cS4M7rp7duftGOsSJz r6gYrqFG3xgmGw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:21 +0100 Message-ID: <9c83cf458fc508990a834cecac3f9d8cbd74df87.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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/mcron.scm (mcron-service-type): Mark as deprecated. * gnu/home/services/mcron.scm (home-mcron-service-type): Likewise. * doc/guix.texi (Scheduled Job Execution): Document it. (Mcron Home Service): Likewise. Change-Id: I0329bf1ef5026d6b7d392a5807f0600ff28c3006 --- doc/guix.texi | 18 ++++++++++++++++++ gnu/home/services/mcron.scm | 7 +++++-- gnu/services/mcron.scm | 7 +++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 35999db9b0..19342c22a3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20851,6 +20851,18 @@ Scheduled Job Execution @cindex cron @cindex mcron @cindex scheduling jobs +@quotation Deprecation Warning +This section describes the mcron service, which is deprecated and slated +for removal after 2026-04-01. + +The Shepherd supports running jobs periodically by defining services as +@dfn{timers}. @xref{Shepherd Services} for information on defining +Shepherd services in Guix, and @ref{Timers,,, shepherd, The GNU Shepherd +Manual} for information on Shepherd timers. + +Please use the Shepherd instead mcron. +@end quotation + The @code{(gnu services mcron)} module provides an interface to GNU@tie{}mcron, a daemon to run jobs at scheduled times (@pxref{Top,,, mcron, GNU@tie{}mcron}). GNU@tie{}mcron is similar to the traditional @@ -48514,6 +48526,12 @@ Mcron Home Service @cindex mcron @cindex scheduling jobs +@quotation Deprecation Warning +The @code{home-mcron-service-type} described below is superseded by +Shepherd timers and slated for removal after 2026-04-01. +@xref{Scheduled Job Execution}, for more information. +@end quotation + The @code{(gnu home services mcron)} module provides an interface to GNU@tie{}mcron, a daemon to run jobs at scheduled times (@pxref{Top,,, mcron, GNU@tie{}mcron}). The information about system's mcron is diff --git a/gnu/home/services/mcron.scm b/gnu/home/services/mcron.scm index 23be44ba07..57b92da2eb 100644 --- a/gnu/home/services/mcron.scm +++ b/gnu/home/services/mcron.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2021, 2023 Andrew Tropin ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2022 Maxim Cournoyer -;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023, 2025 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,6 +20,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu home services mcron) + #:use-module (guix deprecation) #:use-module (gnu home services) #:use-module (gnu home services shepherd) #:use-module (gnu services mcron) ;for the service mapping @@ -53,7 +54,9 @@ (define-syntax-rule (home-mcron-configuration fields ...) ;; Macro provided for backward compatibility. (for-home (mcron-configuration fields ...))) -(define home-mcron-service-type +;; TODO: Deprecated; remove sometime after 2026-04-01. +(define-deprecated home-mcron-service-type + home-shepherd-service-type (service-type (inherit (system->home-service-type mcron-service-type)) (default-value (for-home (mcron-configuration))))) diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm index 0e0d07d252..0bb0ae7450 100644 --- a/gnu/services/mcron.scm +++ b/gnu/services/mcron.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016-2020, 2023 Ludovic Courtès +;;; Copyright © 2016-2020, 2023, 2025 Ludovic Courtès ;;; Copyright © 2022 Maxim Cournoyer ;;; Copyright © 2023 Bruno Victal ;;; @@ -22,6 +22,7 @@ (define-module (gnu services mcron) #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu packages guile-xyz) + #:use-module (guix deprecation) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) @@ -194,7 +195,9 @@ (define (mcron-shepherd-services config) (actions (list (shepherd-schedule-action mcron files))))))))) -(define mcron-service-type +;; TODO: Deprecated; remove sometime after 2026-04-01. +(define-deprecated mcron-service-type + shepherd-root-service-type (service-type (name 'mcron) (description "Run the mcron job scheduling daemon.") From patchwork Sat Mar 15 21:37:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 40230 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 9856327BBEA; Sat, 15 Mar 2025 21:40:13 +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 51DAB27BBE2 for ; Sat, 15 Mar 2025 21:40:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ttZEm-0005fI-Qn; Sat, 15 Mar 2025 17:40:08 -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 1ttZEk-0005cT-VG for guix-patches@gnu.org; Sat, 15 Mar 2025 17:40:07 -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 1ttZEk-00036C-Kz for guix-patches@gnu.org; Sat, 15 Mar 2025 17:40:06 -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:References:In-Reply-To:Date:From:To:Subject; bh=Cv1jyZhj5WsmAPH1TjhOCm8CArfONTontknGhfeI63s=; b=lEVDGguu7GESQsK0reQH2N+1U2KQPtr2XRSrwrafd2UoJL3oQ7M3C1ud+aMsGefgMSr/osza3pnRw0ht6bNWUR/qQFGZMPwfRIa97mYrFdHWu58n2fdtXbTMp3vMwA2N7KGqM+Qo72aKiInUhw1kvcT5q5hjeLwHtBURtjsesBJAyR+nCXzFB4D+Eq/PYmcnE/eGKWyOpB/2xL9SrmJfUTsTalQrlZ4N7JjI4JOJ30AJVOqQbWmreZYu5Vy760VqpFNvEyV1BRWRh2/GJTWB1DrQfB0JQZ8yhciH+B72DI88fyzUSyY5GZPOlETXuqp3BPdfpRzYUosj3BBjWuZnfw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ttZEj-0004dI-48; Sat, 15 Mar 2025 17:40:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77041] [PATCH 16/16] DRAFT news: Add entry for mcron deprecation. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, julien@lepiller.eu, guix-patches@gnu.org Resent-Date: Sat, 15 Mar 2025 21:40:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77041 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77041@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Florian Pelz , Julien Lepiller X-Debbugs-Original-Xcc: Florian Pelz , Julien Lepiller Received: via spool by 77041-submit@debbugs.gnu.org id=B77041.174207476217446 (code B ref 77041); Sat, 15 Mar 2025 21:40:05 +0000 Received: (at 77041) by debbugs.gnu.org; 15 Mar 2025 21:39:22 +0000 Received: from localhost ([127.0.0.1]:43884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttZE2-0004XC-4y for submit@debbugs.gnu.org; Sat, 15 Mar 2025 17:39:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50218) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttZD3-0004PY-VU for 77041@debbugs.gnu.org; Sat, 15 Mar 2025 17:38:23 -0400 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 1ttZCy-0002jE-FN; Sat, 15 Mar 2025 17:38:16 -0400 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=Cv1jyZhj5WsmAPH1TjhOCm8CArfONTontknGhfeI63s=; b=eUHgSKstOzKymvZw0XXG DONYT/d2jgZPLAUPZbLinODakCbojMyJgHAFJYYAlqvxvMppiOe8kw9ELu9s/TLMGjxTkqgpnbqVP 3fjnpuTgOKi7V2aydxXqN2l4FIJBmju88F51lw9qWE+vRewIC2y7EObAYp9m0n2sA46Loewtg72io L76VeJDXtWk/c58TlL2GgwEnMebSsfVYoHZZmlW+plIKAH8q2b/f6RlFU5abpWXWdHY/2vHquql4H ni9fpMBQXhJkrtLRFw66bJ4hxgDms0yBJaa9Yxs/LE4U5W75wfCbnInoiqrI126pl15F4U86NtaRE lImCsTJX5wPhzg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 15 Mar 2025 22:37:22 +0100 Message-ID: <218d5ad8274680771591e5d940dcc7b7e7c0aafd.1742073920.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.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 * etc/news.scm: Add entry. Change-Id: I7e096a8f137e20487f5dac5fca4ae5b05754f5cd --- etc/news.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/etc/news.scm b/etc/news.scm index 8e37bc8bec..368bdb567a 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -37,6 +37,19 @@ (channel-news (version 0) + (entry (commit "XXX") + (title + (en "Scheduled job execution with mcron superseded by Shepherd +timers")) + (body + (en "On Guix System and Guix Home, scheduled job execution with the +mcron package is deprecated; @code{mcron-service-type} and +@code{home-mcron-service-type} are slated for removal after 2026-04-01. + +As a replacement for mcron jobs, you can use Shepherd timers---a feature that +appeared in version 1.0 of the Shepherd. Run @command{info \"(guix) Scheduled +Job Execution\"} for more information on how to transition."))) + (entry (commit "41e62cb10c3049610dc854f1d3e9b91aebd73aed") (title (en "Removable devices now mount under @file{/run/media/$USER} instead of @file{/media}")