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.
This commit is contained in:
Maxim Cournoyer 2022-02-17 10:06:36 -05:00
parent 1059c2bb66
commit 9c15252060
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -1782,6 +1782,12 @@ (define %mumi-accounts
(home-directory "/var/empty") (home-directory "/var/empty")
(shell (file-append shadow "/sbin/nologin"))))) (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 (mumi-shepherd-services config)
(define environment (define environment
#~(list "LC_ALL=en_US.utf8" #~(list "LC_ALL=en_US.utf8"
@ -1799,7 +1805,7 @@ (define environment
,@(if #$mailer? '() '("--disable-mailer"))) ,@(if #$mailer? '() '("--disable-mailer")))
#:environment-variables #$environment #:environment-variables #$environment
#:user "mumi" #:group "mumi" #:user "mumi" #:group "mumi"
#:log-file "/var/log/mumi.log")) #:log-file #$%mumi-log))
(stop #~(make-kill-destructor))) (stop #~(make-kill-destructor)))
(shepherd-service (shepherd-service
(provision '(mumi-worker)) (provision '(mumi-worker))
@ -1809,7 +1815,7 @@ (define environment
'(#$(file-append mumi "/bin/mumi") "worker") '(#$(file-append mumi "/bin/mumi") "worker")
#:environment-variables #$environment #:environment-variables #$environment
#:user "mumi" #:group "mumi" #:user "mumi" #:group "mumi"
#:log-file "/var/log/mumi.worker.log")) #:log-file #$%mumi-worker-log))
(stop #~(make-kill-destructor))) (stop #~(make-kill-destructor)))
(shepherd-service (shepherd-service
(provision '(mumi-mailer)) (provision '(mumi-mailer))
@ -1825,9 +1831,15 @@ (define environment
'())) '()))
#:environment-variables #$environment #:environment-variables #$environment
#:user "mumi" #:group "mumi" #:user "mumi" #:group "mumi"
#:log-file "/var/log/mumi.mailer.log")) #:log-file #$%mumi-mailer-log))
(stop #~(make-kill-destructor))))))) (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 (define mumi-service-type
(service-type (service-type
(name 'mumi) (name 'mumi)
@ -1837,7 +1849,9 @@ (define mumi-service-type
(service-extension account-service-type (service-extension account-service-type
(const %mumi-accounts)) (const %mumi-accounts))
(service-extension shepherd-root-service-type (service-extension shepherd-root-service-type
mumi-shepherd-services))) mumi-shepherd-services)
(service-extension rottlog-service-type
(const %mumi-log-rotations))))
(description (description
"Run Mumi, a Web interface to the Debbugs bug-tracking server.") "Run Mumi, a Web interface to the Debbugs bug-tracking server.")
(default-value (default-value