From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GGmtMMEbRmJZFwEAgWs5BA (envelope-from ) for ; Thu, 31 Mar 2022 23:23:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oMsaLsEbRmIn/gAA9RJhRA (envelope-from ) for ; Thu, 31 Mar 2022 23:23:13 +0200 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 5D0D31D70B for ; Thu, 31 Mar 2022 23:23:13 +0200 (CEST) Received: from localhost ([::1]:50720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1na2G7-0004fp-WB for larch@yhetil.org; Thu, 31 Mar 2022 17:23:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1na2Fz-0004fG-7g for guix-patches@gnu.org; Thu, 31 Mar 2022 17:23:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46119) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1na2Fy-00071N-Vc for guix-patches@gnu.org; Thu, 31 Mar 2022 17:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1na2Fy-00020n-SE for guix-patches@gnu.org; Thu, 31 Mar 2022 17:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54659] [PATCH 2/2] services: Add 'log-cleanup' service to '%base-services' for build logs. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 31 Mar 2022 21:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54659 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54659@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54659-submit@debbugs.gnu.org id=B54659.16487617497668 (code B ref 54659); Thu, 31 Mar 2022 21:23:02 +0000 Received: (at 54659) by debbugs.gnu.org; 31 Mar 2022 21:22:29 +0000 Received: from localhost ([127.0.0.1]:40015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1na2FR-0001zc-2L for submit@debbugs.gnu.org; Thu, 31 Mar 2022 17:22:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1na2FL-0001z7-P5 for 54659@debbugs.gnu.org; Thu, 31 Mar 2022 17:22:24 -0400 Received: from [2001:470:142:3::e] (port=41452 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1na2FG-0006zJ-IZ; Thu, 31 Mar 2022 17:22:18 -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=pILZFN0Z6d8rWyfwohn3pJ3h5aD3YI68E943A5/nC2c=; b=VHqzK1aOQRH9IcNxoEYZ idalTVn2MYcIlomKlkliQrKVgIXlTDFX/Jsyt+Vrj5Y94AaVPxLoXOyD/d4OyQEdH04RK5134GMGD Fsb65wNt4orenvaXJUs4W6eoM1ps3q/GBB10lkjy8wOBLO06TPIk85MSQAi3nkQZjsXhM5IEI+UqM CsajA2gwALglkcJCUEA9hYcJ0Tp7jbQis307MvuZfUJ/EF0UZ3IcC3JW02OARfPYdb1yO+u8cGdLl JJkvcGNcEe8StGzZ4x6Ff1nyQ0fsdWfRWZcFWauNV/oFqrLtGFLlVNZxcO6YwuGt6UgoaUJbkeMSc KeM2UAVUFVk3Dg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53161 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1na2FG-0002H8-6c; Thu, 31 Mar 2022 17:22:18 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 31 Mar 2022 23:22:08 +0200 Message-Id: <20220331212208.24385-2-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220331212208.24385-1-ludo@gnu.org> References: <20220331212208.24385-1-ludo@gnu.org> MIME-Version: 1.0 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648761793; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=pILZFN0Z6d8rWyfwohn3pJ3h5aD3YI68E943A5/nC2c=; b=Ebht2YspmaztmqDETT/DHgyeQrUkZrnSZQjcENl1xAViDnH//Ek8QLSkv2RL3F5O/1IB52 /Pyv1qBSVQhZ4VAfHf0FrJ2Hl258TEysG+aW8t8tvFvDOo6e4dOFduXttYNNYqfo01AaKw KO9GXghYXdnFaVVBHK/5TYXGbGiUv2MJMSiFlmwqbtY3kdAhdfaXFS4VRusSmF9qorK/t4 QsSwZJmLEo0Nltn9YO+TwaAacqKFJ2rePlJGG42HZo0vs3N6XZ5D/iG3lSGXsZ0xgom0Cg kVVM6Wk6MBbodYYkk10Ujrkl/wjCKOYMoFsFNyxLggWTaBEdMbOgTx25ihdbcA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648761793; a=rsa-sha256; cv=none; b=scO6yVfPhOB339YbtrASwnR28XhzTfdgb7oJvu0qRBzZXHb63gSxzl1WW4DOh1B2U1rb+a 5yB6r3vl2bppS2Mlv5P5tY4VFComqhJhnzch7X55AQw1N2YDdiE1b2p5/jwToSKN0gu037 89lBfADHp0JgrCwjgGj9lWnTmO3lxlqi+Hojh5BNhD2EPQKiuZkBcnREfUsqyRXJMGj/TD zkyqTkDFDhSwpOQA5NZqZewrikzYkza9WrpJm5q3WhHO+pw9fLyG34zaQbpZ9sN+4y1JVx PVm4Gsb2diBR1JMK9L+iouc7xIL1+DuHC+SYq69LWBZmULagWXXKXhwHvC+Lqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VHqzK1aO; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -3.07 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VHqzK1aO; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: 5D0D31D70B X-Spam-Score: -3.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: I7xJljPQOEaV * gnu/services/base.scm (%base-services): Add 'log-cleanup-service-type' instance. * doc/guix.texi (Log Rotation): Add example and mention '%base-services'. --- doc/guix.texi | 13 ++++++++++++- gnu/services/base.scm | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index ad2763ec8a..eaaf829aa2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17645,7 +17645,18 @@ Some log files just need to be deleted periodically once they are old, without any other criterion and without any archival step. This is the case of build logs stored by @command{guix-daemon} under @file{/var/log/guix/drvs} (@pxref{Invoking guix-daemon}). The -@code{log-cleanup} service addresses this use case. +@code{log-cleanup} service addresses this use case. For example, +@code{%base-services} (@pxref{Base Services}) includes the following: + +@lisp +;; Periodically delete build logs more than 4 months old. +(service log-cleanup-service-type + (log-cleanup-configuration + (directory "/var/log/guix/drvs") + (expiry (* 4 30 24 3600)))) +@end lisp + +That ensures build logs do not accumulate endlessly. @defvr {Scheme Variable} log-cleanup-service-type This is the type of the service to delete old logs. Its value must be a diff --git a/gnu/services/base.scm b/gnu/services/base.scm index f278cb76de..ebaba524bc 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2817,6 +2817,12 @@ (define %base-services (service rottlog-service-type) + ;; Periodically delete build logs more than 4 months old. + (service log-cleanup-service-type + (log-cleanup-configuration + (directory "/var/log/guix/drvs") + (expiry (* 4 30 24 3600)))) + ;; The LVM2 rules are needed as soon as LVM2 or the device-mapper is ;; used, so enable them by default. The FUSE and ALSA rules are ;; less critical, but handy. -- 2.34.0