From d6a8f0a9781a90c3037f25e51d7ff32e50f7a8c1 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Fri, 2 Oct 2020 14:58:01 +0200 Subject: services: cuirass: Fix activation. Fixes: . * gnu/services/cuirass.scm (cuirass-activation): Do not create queries-log-file and web-queries-log-file if the corresponding config file are unset. --- gnu/services/cuirass.scm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm index d4faf7823b..a50f583807 100644 --- a/gnu/services/cuirass.scm +++ b/gnu/services/cuirass.scm @@ -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)) - - (chown #$queries-log-file uid gid) - (chown #$web-queries-log-file uid gid)))))) + (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))) + + (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." -- cgit v1.2.3