aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-06-08 20:23:08 +0200
committerLudovic Courtès <ludo@gnu.org>2017-06-12 23:34:14 +0200
commit254ea3f945e8bc44f8c3a4159302f24f4fe5f216 (patch)
treef99002ca3294b2d1329a887673723a22dbe5caca
parent81fa2229ecb80a8ae90c8e24771e1df880e75383 (diff)
downloadguix-254ea3f945e8bc44f8c3a4159302f24f4fe5f216.tar
guix-254ea3f945e8bc44f8c3a4159302f24f4fe5f216.tar.gz
services: rottlog: Make extensible.
* gnu/services/admin.scm (rottlog-service-type)[compose, extend]: New fields. * doc/guix.texi (Log Rotation): Mention extension.
-rw-r--r--doc/guix.texi3
-rw-r--r--gnu/services/admin.scm6
2 files changed, 9 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index b8675bde2a..ffd2028de9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9561,6 +9561,9 @@ with the default settings, for commonly encountered log files.
This is the type of the Rottlog service, whose value is a
@code{rottlog-configuration} object.
+Other services can extend this one with new @code{log-rotation} objects
+(see below), thereby augmenting the set of files to be rotated.
+
This service type can define mcron jobs (@pxref{Scheduled Job
Execution}) to run the rottlog service.
@end defvr
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm
index 99f3b1da16..b9e3fa70a4 100644
--- a/gnu/services/admin.scm
+++ b/gnu/services/admin.scm
@@ -164,6 +164,12 @@ for ROTATION."
;; the documentation.
(service-extension profile-service-type
(compose list rottlog-rottlog))))
+ (compose concatenate)
+ (extend (lambda (config rotations)
+ (rottlog-configuration
+ (inherit config)
+ (rotations (append (rottlog-rotations config)
+ rotations)))))
(default-value (rottlog-configuration))))
;;; admin.scm ends here