summary refs log tree commit diff
path: root/gnu/services
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-04-29 12:02:48 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-07-26 10:40:16 -0400
commit0db2fa1ac081f684eb15e4ef8561f6e2853527bd (patch)
tree3103c373b90bec6be6fbf09676bff5aae1cb100f /gnu/services
parent131746885ccd050c4a440d2129aea5bfa86c29e2 (diff)
downloadguix-0db2fa1ac081f684eb15e4ef8561f6e2853527bd.tar.gz
services: mpd: Do not rotate logs when using syslog.
* gnu/services/audio.scm (mpd-log-rotation): Conditionlize based on the value
of LOG-FILE.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/audio.scm21
1 files changed, 11 insertions, 10 deletions
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index f3c8fae23c..8a127d234b 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -581,12 +581,15 @@ appended to the 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>
@@ -674,10 +677,8 @@ MPD (PID ~a)." pid))
    (extensions
     (list (service-extension shepherd-root-service-type
                              (compose list mpd-shepherd-service))
-          (service-extension account-service-type
-                             mpd-accounts)
-          (service-extension rottlog-service-type
-                             (compose list mpd-log-rotation))))
+          (service-extension account-service-type mpd-accounts)
+          (service-extension rottlog-service-type mpd-log-rotation)))
    (default-value (mpd-configuration))))