Fixes <https://bugs.gnu.org/44820>.
Reported by Simon <lists@netpanic.org>.
This is a followup to bb124f6e9c.
* gnu/services/audio.scm (mpd-service-activation): Chown the parent of
DIRECTORY as well.
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.
Running 'guix system search mpd' would throw a backtrace because the
mpd-shepherd-service service start Gexp contained an unquoted call to
'getpwnam', which would look for a missing 'mpd' user and fail.
* gnu/services/audio.scm (mpd-shepherd-service): gexp-unquote only the
relevant variable rather than the whole expression.
* gnu/services/audio.scm (<mpd-output>): New record type.
(<mpd-configuration>)[outputs]: New field.
(mpd-output, mpd-output?, mpd-output->string): New procedures.
(mpd-config->file): Use mpd-output->string.
* doc/guix.texi (Audio Services): Document mpd-output fields.
Since MPD switches user, the pid-file must be in a writable dir. This
is now always /var/run/mpd/(user)/pid.
* gnu/services/audio.scm (mpd-service-type): Add a activation-service
extension.
(<mpd-configuration>)[pid-file]: Remove.
(mpd-service): Rename to...
(mpd-shepherd-service): ... this.
(mpd-file-name, mpd-service-activation): New procedure.
* doc/guix.texi (Audio Services): Document the changes.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* doc/guix.texi: Add documentation.
* gnu/services/audio.scm (<mpd-configuration>): New record type.
(mpd-service-type): New service type.
* gnu/tests/audio.scm: New file.
* gnu/local.mk: Add new files.
Signed-off-by: Christopher Baines <mail@cbaines.net>