services: cuirass: Fix activation.

Fixes: <https://issues.guix.gnu.org/43760>.

* gnu/services/cuirass.scm (cuirass-activation): Do not create
queries-log-file and web-queries-log-file if the corresponding config file are
unset.
This commit is contained in:
Mathieu Othacehe 2020-10-02 14:58:01 +02:00
parent 23ad7e92b1
commit d6a8f0a978
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -204,11 +204,15 @@ (define (cuirass-activation config)
(chown #$db uid gid)
(chown #$log uid gid)
(call-with-output-file #$queries-log-file (const #t))
(call-with-output-file #$web-queries-log-file (const #t))
(let ((queries-log-file #$queries-log-file))
(when queries-log-file
(call-with-output-file queries-log-file (const #t))
(chown #$queries-log-file uid gid)))
(chown #$queries-log-file uid gid)
(chown #$web-queries-log-file uid gid))))))
(let ((web-queries-log-file #$web-queries-log-file))
(when web-queries-log-file
(call-with-output-file web-queries-log-file (const #t))
(chown web-queries-log-file uid gid))))))))
(define (cuirass-log-rotations config)
"Return the list of log rotations that corresponds to CONFIG."