[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: services: web: Rotate mumi logs.
From: |
guix-commits |
Subject: |
01/03: services: web: Rotate mumi logs. |
Date: |
Thu, 17 Feb 2022 13:42:49 -0500 (EST) |
apteryx pushed a commit to branch master
in repository guix.
commit 9c15252060ba1f4764375966afd3a62091f2b311
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Thu Feb 17 10:06:36 2022 -0500
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.
---
gnu/services/web.scm | 22 ++++++++++++++++++----
1 file 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