[Top][All Lists]

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

03/04: services: cuirass: Extend rottlog with log rotations.

From: Ludovic Courtès
Subject: 03/04: services: cuirass: Extend rottlog with log rotations.
Date: Mon, 12 Jun 2017 17:34:22 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit d782de172c68119499202ddac03fdce53ad89a35
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jun 12 23:30:53 2017 +0200

    services: cuirass: Extend rottlog with log rotations.
    * gnu/services/cuirass.scm (cuirass-log-rotations): New procedure.
    (cuirass-service-type): Use it to extend ROTTLOG-SERVICE-TYPE.
 gnu/services/cuirass.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm
index 6beabc4..88a9a86 100644
--- a/gnu/services/cuirass.scm
+++ b/gnu/services/cuirass.scm
@@ -26,6 +26,7 @@
   #:use-module (gnu services)
   #:use-module (gnu services base)
   #:use-module (gnu services shepherd)
+  #:use-module (gnu services admin)
   #:use-module (gnu system shadow)
   #:export (<cuirass-configuration>
@@ -138,6 +139,13 @@
             (chown #$cache uid gid)
             (chown #$db uid gid))))))
+(define (cuirass-log-rotations config)
+  "Return the list of log rotations that corresponds to CONFIG."
+  (list (log-rotation
+         (files (list (cuirass-configuration-log-file config)))
+         (frequency 'weekly)
+         (options '("rotate 40")))))              ;worth keeping
 (define cuirass-service-type
    (name 'cuirass)
@@ -145,6 +153,7 @@
      (service-extension profile-service-type      ;for 'info cuirass'
                         (compose list cuirass-configuration-cuirass))
+     (service-extension rottlog-service-type cuirass-log-rotations)
      (service-extension activation-service-type cuirass-activation)
      (service-extension shepherd-root-service-type cuirass-shepherd-service)
      (service-extension account-service-type cuirass-account)))))

reply via email to

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