summary refs log tree commit diff
path: root/gnu/services
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-02-17 10:06:36 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-02-17 13:39:02 -0500
commit9c15252060ba1f4764375966afd3a62091f2b311 (patch)
tree232b6fc251c27acc877d8f77b0d69c4861d77168 /gnu/services
parent1059c2bb66cca89c7619e595502e3e17f1aa1c81 (diff)
downloadguix-9c15252060ba1f4764375966afd3a62091f2b311.tar.gz
services: web: Rotate mumi logs.
* gnu/services/web.scm (%mumi-log, %mumi-mailer-log, %mumi-worker-log): New
variables.
(mumi-shepherd-services): Use them.
(%mumi-log-rotations): New variable.
(mumi-service-type): Extend rottlog.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/web.scm22
1 files changed, 18 insertions, 4 deletions
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 3fe58d98e6..2c7df19222 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -1782,6 +1782,12 @@ WSGIPassAuthorization On
          (home-directory "/var/empty")
          (shell (file-append shadow "/sbin/nologin")))))
 
+(define %mumi-log "/var/log/mumi.log")
+
+(define %mumi-mailer-log "/var/log/mumi.mailer.log")
+
+(define %mumi-worker-log "/var/log/mumi.worker.log")
+
 (define (mumi-shepherd-services config)
   (define environment
     #~(list "LC_ALL=en_US.utf8"
@@ -1799,7 +1805,7 @@ WSGIPassAuthorization On
                         ,@(if #$mailer? '() '("--disable-mailer")))
                       #:environment-variables #$environment
                       #:user "mumi" #:group "mumi"
-                      #:log-file "/var/log/mumi.log"))
+                      #:log-file #$%mumi-log))
             (stop #~(make-kill-destructor)))
            (shepherd-service
             (provision '(mumi-worker))
@@ -1809,7 +1815,7 @@ WSGIPassAuthorization On
                       '(#$(file-append mumi "/bin/mumi") "worker")
                       #:environment-variables #$environment
                       #:user "mumi" #:group "mumi"
-                      #:log-file "/var/log/mumi.worker.log"))
+                      #:log-file #$%mumi-worker-log))
             (stop #~(make-kill-destructor)))
            (shepherd-service
             (provision '(mumi-mailer))
@@ -1825,9 +1831,15 @@ WSGIPassAuthorization On
                               '()))
                       #:environment-variables #$environment
                       #:user "mumi" #:group "mumi"
-                      #:log-file "/var/log/mumi.mailer.log"))
+                      #:log-file #$%mumi-mailer-log))
             (stop #~(make-kill-destructor)))))))
 
+(define %mumi-log-rotations
+  (list (log-rotation
+         (files (list %mumi-log
+                      %mumi-mailer-log
+                      %mumi-worker-log)))))
+
 (define mumi-service-type
   (service-type
    (name 'mumi)
@@ -1837,7 +1849,9 @@ WSGIPassAuthorization On
           (service-extension account-service-type
                              (const %mumi-accounts))
           (service-extension shepherd-root-service-type
-                             mumi-shepherd-services)))
+                             mumi-shepherd-services)
+          (service-extension rottlog-service-type
+                             (const %mumi-log-rotations))))
    (description
     "Run Mumi, a Web interface to the Debbugs bug-tracking server.")
    (default-value