me
/
guix
Archived
1
0
Fork 0

services: mpd: Fix daemon startup.

Until now it would wait for a PID file that'd never come.

* gnu/services/audio.scm (mpd-shepherd-service): Add 'requirement'.
Remove #:pid-file from 'start'.
(mpd-service-activation): Create the ".mpd" directory since that's what
the daemon expects.
master
Ludovic Courtès 2020-11-06 23:10:18 +01:00
parent 7209d7cbc3
commit bb124f6e9c
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 2 additions and 2 deletions

View File

@ -138,12 +138,12 @@ audio_output {
(define (mpd-shepherd-service config)
(shepherd-service
(documentation "Run the MPD (Music Player Daemon)")
(requirement '(user-processes))
(provision '(mpd))
(start #~(make-forkexec-constructor
(list #$(file-append mpd "/bin/mpd")
"--no-daemon"
#$(mpd-config->file config))
#:pid-file #$(mpd-file-name config "pid")
#:environment-variables
;; Required to detect PulseAudio when run under a user account.
(list (string-append
@ -161,7 +161,7 @@ audio_output {
(define %user
(getpw #$(mpd-configuration-user config)))
(let ((directory #$(mpd-file-name config "")))
(let ((directory #$(mpd-file-name config ".mpd")))
(mkdir-p directory)
(chown directory (passwd:uid %user) (passwd:gid %user))))))