guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

08/13: services: Add 'log-cleanup' service to '%base-services' for build


From: guix-commits
Subject: 08/13: services: Add 'log-cleanup' service to '%base-services' for build logs.
Date: Mon, 4 Apr 2022 17:13:22 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit e692dc632cbb0e6d21ed6f09f4c7f52391802cfb
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Mar 31 23:17:48 2022 +0200

    services: Add 'log-cleanup' service to '%base-services' for build logs.
    
    * 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         | 12 +++++++++++-
 gnu/services/base.scm |  5 +++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ad2763ec8a..b539a78663 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17645,7 +17645,17 @@ 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 old build logs.
+(service log-cleanup-service-type
+         (log-cleanup-configuration
+          (directory "/var/log/guix/drvs")))
+@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..5d7c69a9cd 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2817,6 +2817,11 @@ to handle."
 
         (service rottlog-service-type)
 
+        ;; Periodically delete old build logs.
+        (service log-cleanup-service-type
+                 (log-cleanup-configuration
+                  (directory "/var/log/guix/drvs")))
+
         ;; 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]