Subject: [PATCH v3 09/16] services: mpd: Do not rotate logs when using syslog.

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 5 May 2023 14:29:04 -0400

* gnu/services/audio.scm (mpd-log-rotation): Conditionlize based on the value
of LOG-FILE.
---
 gnu/services/audio.scm | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index c1295837b6..7fb4b8ccf7 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -558,12 +558,15 @@ (define (mpd-serialize-configuration configuration)
    (serialize-configuration configuration mpd-configuration-fields)))
 
 (define (mpd-log-rotation config)
-  (match-record config <mpd-configuration> (log-file)
-    (log-rotation
-     (files (list log-file))
-     (post-rotate #~(begin
-                      (use-modules (gnu services herd))
-                      (with-shepherd-action 'mpd ('reopen) #f))))))
+  (match-record config <mpd-configuration>
+    (log-file)
+    (if (string=? "syslog" log-file)
+        '()                             ;nothing to do
+        (list (log-rotation
+               (files (list log-file))
+               (post-rotate #~(begin
+                                (use-modules (gnu services herd))
+                                (with-shepherd-action 'mpd ('reopen) #f))))))))
 
 (define (mpd-shepherd-service config)
   (match-record config <mpd-configuration>
-- 
2.39.2