From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 8OXDGlW5fmfrdgAAqHPOHw:P1 (envelope-from ) for ; Wed, 08 Jan 2025 17:43:49 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 8OXDGlW5fmfrdgAAqHPOHw (envelope-from ) for ; Wed, 08 Jan 2025 18:43:49 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=nEV0XsJ8; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="ajFPZBJ/"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736358229; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Ybuk2RetGYS+YVsBjWOX8n0lzltYgSskKRb1HStkWyo=; b=YINjfqbbNQSaLwMG7pOVzFNaNXVGwPR5pB0MikjDmQvUhlIOpYXviJ4oD8jaf0VExWUVgE raA9ZpG4Ip/x2mENmCFhhrqZyh3K5etGaqmukSt2DtmZEUA1yVw+zZo+svqNfeOvMNXubg E5rLsEVQ5gFEdadSCvRIPObEr8cjChKWFX4Is4wR/pYyCct5n6N/hn1BU5gzfKDxECeY3Y CakTlddjqvPP/dQJKoI78hSbLKHNdAIKCahKKzBlkrVKu9TymEuw4R8jBj2GusL8WkRNyh tPzc+2raNo9jYF8m4bgQVF2w9BRQJxADBHWadO+A8Ptx6fXTc7r+iyMDX/tNTQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=nEV0XsJ8; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="ajFPZBJ/"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736358229; a=rsa-sha256; cv=none; b=JHGmPFghTDIhSgrxRC8F7W6/hVe8qzCjPaSuIupSs+6/DLkL8mONXPW283LugcwCoTrdK7 0kMkoT/2lBhi94LCjJ0YDBSsuqD0ygJn5+wMWMWUnYgizWJw3QuoF0m6WLZjH3f2fXps3a 6q5wwNd5Jo30flVKX4nOAOhc8enqh8vYiv6y+7uQp7fuGQP8uHPd4Mz59RMChZfOkFvsgN BgypxoRbI8DvsV/MCw2SdSJhzGFlYYLpB5DCYCeZJbG3v/Bv5NX7bqmZjqbE6mllV5941a 4DL8oNTcTj/Z0gmSApDiR119sfP6o6RTbXba4tQ5Z8RpEbLCdqKsDjqZ/9X1oA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4BA0E2C78 for ; Wed, 08 Jan 2025 18:43:49 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVa5V-0005ez-B7; Wed, 08 Jan 2025 12:43:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVa5A-0005Ur-Vq for guix-patches@gnu.org; Wed, 08 Jan 2025 12:43:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVa5A-00039k-Ma; Wed, 08 Jan 2025 12:43:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=Ybuk2RetGYS+YVsBjWOX8n0lzltYgSskKRb1HStkWyo=; b=nEV0XsJ8xU6r/jAQ2F6jV2t1+YNCWknx/y/QVdF2+CSIW6YOxptdRIlxAUL37qO+84pEoyR5BnPtuPjzwV85mO9UCRv9wq2vHCA6VH917cpx7DYG1nww/dxN4fcPTlH4iIYotw4fuZrZs0svacnD5iOBOabVMXlo5CdKiukwrojL/9q1vBhPmMaGdtQJNKuuJSk4IJIfSKikPuqGHXeMA9dIw0wCw2XHw1WeoSPHN8siWkcJA0DS4OniHEzikQCO/EXk/4iN6yTB4R96SwYzQEfYtgf9BUs4Cvt8P5J/QRuuUukvg2QIqGAeU6wZrgDQk93PgWb+jScV5iC2e19asw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVa5A-0007sc-I9; Wed, 08 Jan 2025 12:43:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH v2 04/12] services: log-cleanup: Rewrite as 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: Wed, 08 Jan 2025 17:43:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.173635815930149 (code B ref 74860); Wed, 08 Jan 2025 17:43:04 +0000 Received: (at 74860) by debbugs.gnu.org; 8 Jan 2025 17:42:39 +0000 Received: from localhost ([127.0.0.1]:48798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVa4k-0007q7-LB for submit@debbugs.gnu.org; Wed, 08 Jan 2025 12:42:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60014) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tVa4c-0007oF-BS for 74860@debbugs.gnu.org; Wed, 08 Jan 2025 12:42:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVa4X-0002uA-2G; Wed, 08 Jan 2025 12:42:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Ybuk2RetGYS+YVsBjWOX8n0lzltYgSskKRb1HStkWyo=; b=ajFPZBJ/G27ESE+mwEZL NPx7J00df5MTVi10NMPqvyl/enu0+VkVmzKxUb5jqLSAn+x3Jyrm7CnMSwO+gWvPw0xtG1fPPF1Ft eDYMqx0uJPO/u0Nv0WrlgrGnYve6crdJacr0qMNQZS1/QwWyhwo1tQm9Ep33/xjKGH6HWFmP3hXc3 WVLlomTj1Ff6yNZMy11OWbYj6jzmJDM8YrJXkPGgrwaWWKvWiVmDNOzDIIVlkau3hDWeO6GT8wSX4 R/OGsV30ODGd1B2mhTMyat0TPmjIqX36B5aHZdANyNwbzYBSpMFHOVRmSmJr/+gozsiIwXxwJrU1r Bq+BPk4AUfexGA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 8 Jan 2025 18:41:48 +0100 Message-ID: <788340be0f08a348de1e1dcbd908019e24f465cf.1736357737.git.ludo@gnu.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -2.68 X-Spam-Score: -2.68 X-Migadu-Queue-Id: 4BA0E2C78 X-TUID: JAhdbfR1dqoM This is a semi-incompatible change: gexps previously provided in the ‘schedule’ field will no longer work. * gnu/services/admin.scm (log-cleanup-mcron-jobs): Remove. (log-cleanup-shepherd-services): New procedure. (log-cleanup-service-type): Extend SHEPHERD-ROOT-SERVICE-TYPE instead of MCRON-SERVICE-TYPE. * doc/guix.texi (Log Rotation): Adjust ‘schedule’ documentation accordingly. Change-Id: I2a3beb7dffbc9992b714a29423674db9c7dc6cab --- doc/guix.texi | 5 +++-- gnu/services/admin.scm | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f521a2d2ad..e1d08c2f10 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21084,8 +21084,9 @@ Log Rotation default). @item @code{schedule} (default: @code{"30 12 01,08,15,22 * *"}) -String or gexp denoting the corresponding mcron job schedule -(@pxref{Scheduled Job Execution}). +Schedule of the log cleanup job written either as a string in +traditional cron syntax or as a gexp representing a Shepherd calendar +event (@pxref{Timers,,, shepherd, The GNU Shepherd Manual}). @end table @end deftp diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index deaa3b6c89..7d202d737e 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -385,18 +385,31 @@ (define (log-cleanup-program directory expiry) (length logs) #$directory) (for-each delete-file logs)))))) -(define (log-cleanup-mcron-jobs configuration) +(define (log-cleanup-shepherd-services configuration) (match-record configuration - (directory expiry schedule) - (list #~(job #$schedule - #$(log-cleanup-program directory expiry))))) + (directory expiry schedule) + (let ((program (log-cleanup-program directory expiry))) + (list (shepherd-service + (provision '(log-cleanup)) + (requirement '(user-processes)) + (modules '((shepherd service timer))) + (start #~(make-timer-constructor + #$(if (string? schedule) + #~(cron-string->calendar-event #$schedule) + schedule) + (command '(#$program)))) + (stop #~(make-timer-destructor)) + (actions (list (shepherd-action + (name 'trigger) + (documentation "Trigger log cleanup.") + (procedure #~trigger-timer))))))))) (define log-cleanup-service-type (service-type (name 'log-cleanup) (extensions - (list (service-extension mcron-service-type - log-cleanup-mcron-jobs))) + (list (service-extension shepherd-root-service-type + log-cleanup-shepherd-services))) (description "Periodically delete old log files."))) -- 2.47.1