services: rottlog: Make extensible.

* gnu/services/admin.scm (rottlog-service-type)[compose, extend]: New
fields.
* doc/guix.texi (Log Rotation): Mention extension.
This commit is contained in:
Ludovic Courtès 2017-06-08 20:23:08 +02:00
parent 81fa2229ec
commit 254ea3f945
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
2 changed files with 9 additions and 0 deletions

View File

@ -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 This is the type of the Rottlog service, whose value is a
@code{rottlog-configuration} object. @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 This service type can define mcron jobs (@pxref{Scheduled Job
Execution}) to run the rottlog service. Execution}) to run the rottlog service.
@end defvr @end defvr

View File

@ -164,6 +164,12 @@ for ROTATION."
;; the documentation. ;; the documentation.
(service-extension profile-service-type (service-extension profile-service-type
(compose list rottlog-rottlog)))) (compose list rottlog-rottlog))))
(compose concatenate)
(extend (lambda (config rotations)
(rottlog-configuration
(inherit config)
(rotations (append (rottlog-rotations config)
rotations)))))
(default-value (rottlog-configuration)))) (default-value (rottlog-configuration))))
;;; admin.scm ends here ;;; admin.scm ends here