me
/
guix
Archived
1
0
Fork 0

services: mpd: Do not rotate logs when using syslog.

* gnu/services/audio.scm (mpd-log-rotation): Conditionlize based on the value
of LOG-FILE.
Maxim Cournoyer 2023-04-29 12:02:48 -04:00
parent 131746885c
commit 0db2fa1ac0
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 11 additions and 10 deletions

View File

@ -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))))