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'.master
parent
3b9b3b4931
commit
e692dc632c
|
@ -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
|
without any other criterion and without any archival step. This is the
|
||||||
case of build logs stored by @command{guix-daemon} under
|
case of build logs stored by @command{guix-daemon} under
|
||||||
@file{/var/log/guix/drvs} (@pxref{Invoking guix-daemon}). The
|
@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
|
@defvr {Scheme Variable} log-cleanup-service-type
|
||||||
This is the type of the service to delete old logs. Its value must be a
|
This is the type of the service to delete old logs. Its value must be a
|
||||||
|
|
|
@ -2817,6 +2817,11 @@ to handle."
|
||||||
|
|
||||||
(service rottlog-service-type)
|
(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
|
;; 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
|
;; used, so enable them by default. The FUSE and ALSA rules are
|
||||||
;; less critical, but handy.
|
;; less critical, but handy.
|
||||||
|
|
Reference in New Issue