unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 27291@debbugs.gnu.org
Subject: bug#27291: [PATCH 2/2] services: rottlog: Make extensible.
Date: Thu,  8 Jun 2017 22:53:52 +0200	[thread overview]
Message-ID: <20170608205352.21398-2-ludo@gnu.org> (raw)
In-Reply-To: <20170608205352.21398-1-ludo@gnu.org>

* gnu/services/admin.scm (rottlog-service-type)[compose, extend]: New
fields.
* doc/guix.texi (Log Rotation): Mention extension.
---
 doc/guix.texi          | 3 +++
 gnu/services/admin.scm | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 597fb9812..8a08fd9f7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9560,6 +9560,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 99f3b1da1..b9e3fa70a 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
-- 
2.13.0

  reply	other threads:[~2017-06-08 20:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 20:31 bug#27291: [PATCH 0/2] Provide a Schemey interface to the Rottlog service Ludovic Courtès
2017-06-08 20:53 ` bug#27291: [PATCH 1/2] services: rottlog: Define <log-rotation> objects Ludovic Courtès
2017-06-08 20:53   ` Ludovic Courtès [this message]
2017-06-12 21:34 ` bug#27291: [PATCH 0/2] Provide a Schemey interface to the Rottlog service Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170608205352.21398-2-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=27291@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).