From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4HPeImWmdmeCSwEAe85BDQ:P1 (envelope-from ) for ; Thu, 02 Jan 2025 14:44:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 4HPeImWmdmeCSwEAe85BDQ (envelope-from ) for ; Thu, 02 Jan 2025 15:44:53 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=lXjS8SrE; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=fo8rhQZR; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735829093; 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=r1xZe/fmb2R7hXzR2NbnzGUY4MxAUb4hBJWjlBIecCQ=; b=IYGl3anSe4PqR1Es6WAGO/cnN717Dg99X03PFY71hz3Wz7pzErFRepZY6O9keV6q+jDC4Z 5loHDilS18RVA6SzmagtrocMx5C7Ggp4coL/1vzJiUlcgGZ6zdgUgtYfoPZNPkArJvVTj2 UMXd/OV2mfNAn/Dxn3TyYJmwaGdvpTAEo5+Jw/rMucjzYzyE7ec/x+4+yEoofS/TNU/ORi gRFEuaxmlYuY6M3T8I+Wtyvp5sIqIJxNNnfYRPWDP+LfhMTbOLllGwxk1yR3cLf3dzmuqd uWsniTtcastesfi/oy7N27JxAiG/nVLSo9BpYBZcrk1/eVi5sQG8z89dJig0aA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=lXjS8SrE; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=fo8rhQZR; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735829093; a=rsa-sha256; cv=none; b=e69ug3+j/KL70e8Apaolh/w23rTmp19LkMRZ5g/Ya24R5tNTf0Yzb2JudgyU4aeTCuH92s RK8jQrzEgHXoqtGQbzBhrTxSFZemuyC1/TmkcHxOWRs6qyMcmdKVxuQSWqNUkoaTlEd4fN JeHKyPGsuWT2PXfO83s2jPV86S8Ul1+6AazeUaUnYvj5Nogulacs5iMCBvySFhwwxyn9Ii exdkF8gwy6OnTFXIlJAXROM9qytYwBdoo6xD/CHqfrZm6x9aburv9reMi9/BdlPySsFzHf Ijww3bwZM16CiGClEULOIWZKe2I/pHZd4tdMEHjUpptA34mkBNNDN45nJWNNGQ== 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 33A535EABB for ; Thu, 02 Jan 2025 15:44:53 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTM4S-0006HL-4C; Thu, 02 Jan 2025 09:21:09 -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 1tTM4O-0006Gx-Qz for guix-patches@gnu.org; Thu, 02 Jan 2025 09:21:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTM4N-0007Et-J9 for guix-patches@gnu.org; Thu, 02 Jan 2025 09:21:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=nd/BJOaKr/blLr7keJ9Ot59fIhkd0ACm3nTaT9l2XgU=; b=lXjS8SrENwZpXn87gnT0Vo7NbTM3/wjbuzcW+efj0vDHyFISQ+H+OcSjeApWGJeSHG5odYN29jY0wiUv2Jkom6GZtrxXSbL3Jt18DvMvo1ENrBG5UQ870nxzSe/Usm3qUyacQqLHJ7KM1nghw/K9nYZnLjMK2q2aeZLhm+tlgvyUTl7cxugBqtUYmYw2fQEHcCR+f1I+YCXlYoCjserpILJyldXhSw3qtfZkNpcvdNdS6NHCQ9iLPTRGC06xJ8G3SZeNOLCmcjYvrAxKUyjxNOjXv8933ACh//ae2Mt6U9/rqhD+X0BYj+lxHlHFYlkwhPccHBhYGB1pb5zsfwi6xw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTM4M-0002ht-DM for guix-patches@gnu.org; Thu, 02 Jan 2025 09:21:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 02/10] services: Add =?UTF-8?Q?=E2=80=98log-rotation-service-type=E2=80=99.?= Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 02 Jan 2025 14:21:02 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 74860@debbugs.gnu.org Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.173582760710111 (code B ref 74860); Thu, 02 Jan 2025 14:21:02 +0000 Received: (at 74860) by debbugs.gnu.org; 2 Jan 2025 14:20:07 +0000 Received: from localhost ([127.0.0.1]:43285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTM3S-0002cn-QO for submit@debbugs.gnu.org; Thu, 02 Jan 2025 09:20:07 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:59862) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTM3Q-0002ap-Ej for 74860@debbugs.gnu.org; Thu, 02 Jan 2025 09:20:05 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2166651f752so179641575ad.3 for <74860@debbugs.gnu.org>; Thu, 02 Jan 2025 06:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735827602; x=1736432402; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nd/BJOaKr/blLr7keJ9Ot59fIhkd0ACm3nTaT9l2XgU=; b=fo8rhQZRA+QpYRdNjFaGA/OuBk5JVYq75tGxab7zb7WfrT2Bpew3onvmVtob0f7C6d t5xQc7wLytnne+ZfiFfk+E4kihdy5k48G5O+S8DyZmFRllcubdS8xgGTZXlAq2JmghqF 2ymfpqRxhCEHqVZZ12VKC9uLJazCRore+AE3iOKpH0yrNmzw5w1yWg4R8XnnLiBMRWpb ADDv5tjRLkmUn4CTt0G96WPgxcIr/dCCA97yaNUhT2XlmZ0R8G+qQqVUrmV20vX2eSaD f7TeJTGc9qksSe7RYnDJgyiNASTa9jtA6IS4Agnwz+4aIVYAbVrz+WIqnXcL3cC3EWmN H7sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735827602; x=1736432402; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nd/BJOaKr/blLr7keJ9Ot59fIhkd0ACm3nTaT9l2XgU=; b=oMUeQOvySSMgfqT4dfDCasJoUM9gifRpUlHg0aKagnOwTl4VXWK1xDxPujKnoN2xFP /rW+q+kV5wLYyVKS7z4UedX1mWru/FBC0yg4JyUkO/dSotrHirr4Hm4tkRw4VgPUseua 1VhlVwYiYSQijlrxkQRun6hmr9MiWsraLlHxoF9W4dBc0cA+iLc9gjjYB8psNaSSb6/Y VrHoDhQu6PIn8QT66jmyepUld4OE4yy1N4OGVNqQDpYjaQIARgzjbrphXKc46B4ESgnX 6X5g4JSu5AAO0yB1/qFm2gw1WXaLFfvBDxJd2EBkwCzKu+QC/qaAU7bSNBuOtmLaiOPx PGSg== X-Gm-Message-State: AOJu0YxUEp2rGj5Bx3IHi3dKwmrjBNrdIa4aiM2SvRQqAI4Dj6qKCl5S b9+SnP2ufL03XTBTWAcv5nhrihI85CsjDFNK020/7M0yyxBKlaEI7+VWApKr X-Gm-Gg: ASbGnctxGwnKK2VgU3IA+tXJgYB+VO7WwyDah543LebeWWrjtmf/rwfXMbjWPsMnmGm 6HgVWbvWfKg3tlizmMq7jsWG9XzrJnfh8f/iqBnI3hglQDmZuvHeVdXx5xb78rIR/6E/mhQNAts cPOWoe+vtA8BaXKMZW0FyX1A0xj4JRe0B3ab+nhtJeSdfpB7CUXGdbpW4KTakjiErIq/Vr+P8/j nj2cXVrJnHZAU8iCG9HtIn/pH31sVg3gTVGPNCUqgqtNuxGcS00ow== X-Google-Smtp-Source: AGHT+IEjC9C8z26R6JdNLuSFPZGrbZBHAsfTp6olitX5/DTaRPenkS/OAcpeNKrCdolhsHfd9vUr4Q== X-Received: by 2002:a17:902:f602:b0:216:3c2b:a5e5 with SMTP id d9443c01a7336-219e6ebb682mr629360165ad.27.1735827602204; Thu, 02 Jan 2025 06:20:02 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9cde0dsm228154655ad.140.2025.01.02.06.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 06:20:01 -0800 (PST) From: Maxim Cournoyer In-Reply-To: <97dd04a5fbb49bcacc4b7d61749f64c8c6fae9d5.1734129908.git.ludo@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Fri, 13 Dec 2024 23:58:22 +0100") References: <97dd04a5fbb49bcacc4b7d61749f64c8c6fae9d5.1734129908.git.ludo@gnu.org> Date: Thu, 02 Jan 2025 23:19:51 +0900 Message-ID: <87seq15md4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 33A535EABB X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: 0.41 X-Spam-Score: 0.41 X-TUID: 1B/YsvrQiPA8 Hi Ludovic, Ludovic Court=C3=A8s writes: > * gnu/services/admin.scm (%default-log-rotation-calendar-event): New > variable. > (): New record type. > (log-rotation-shepherd-services): New procedure. > (log-rotation-service-type): New variable. Neat. [...] > +@item @code{compression} (default: @code{'gzip}) > +This is the compression method used for rotated log files, one of > +@code{'none}, @code{'gzip}, and @code{'zstd}. Why not default to zstd? It's superior to gzip in all regards, as far as I know. We use it already preferably to gzip to compress man pages for example. Perhaps we should consider it as our default compressor from now on? [...] > + > +;;; > +;;; Shepherd's log rotation service. > +;;; > + > +(define %default-log-rotation-calendar-event > + ;; Default calendar event when log rotation is triggered. > + #~(calendar-event #:minutes '(0) > + #:hours '(22) > + #:days-of-week '(sunday))) > + > +(define-record-type* > + log-rotation-configuration make-log-rotation-configuration > + log-rotation-configuration? > + (provision log-rotation-configuration-provision (default '(log-ro= tation))) > + (requirement log-rotation-configuration-requirement > + (default (if for-home? '() '(user-processes)))) > + (calendar-event log-rotation-configuration-calendar-event > + (default %default-log-rotation-calendar-event)) > + (external-log-files log-rotation-configuration-external-log-files > + (default '())) > + (compression log-rotation-configuration-compression (default 'gzip)) > + (expiry log-rotation-configuration-expiry > + (default #~(%default-log-expiry))) > + (size-threshold log-rotation-configuration-size-threshold > + (default #~(%default-rotation-size-threshold)))) Is there a technical reason for not using define-configuration here? Otherwise, define-configuration offers superior error checking and useful error messages on invalid input types. If possible, I think it'd be nice to see this done with define-configuration, for the reasons I explained above. Otherwise it LGTM. Could you please send a v2 addressing this? --=20 Thanks, Maxim