GNU bug report logs - #63082
mpd defaul configuration does not work ('No database' error)

Previous Next

Package: guix;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Wed, 26 Apr 2023 02:59:02 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #218 received at 63082 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 63082 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 02/16] services: mpd: Add an 'update' action to trigger a
 database update.
Date: Fri,  5 May 2023 14:28:57 -0400
* gnu/services/audio.scm (mpd-shepherd-service): Register a new update action.
* doc/guix.texi (Audio Services): Document it.
---
 doc/guix.texi          | 10 ++++++++++
 gnu/services/audio.scm | 11 +++++++++++
 2 files changed, 21 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 66eb44812d..d68d7dd7eb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -33575,6 +33575,16 @@ Audio Services
           (port "6666")))
 @end lisp
 
+Most MPD clients will trigger a database update upon connecting, but you
+can also use the @code{update} action do to so:
+
+@example
+herd update mpd
+@end example
+
+All the MPD configuration fields are documented below, and a more
+complex example follows.
+
 @defvar mpd-service-type
 The service type for @command{mpd}
 @end defvar
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index 8c061da47f..6e4ce3f9fb 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -620,6 +620,17 @@ (define (mpd-shepherd-service config)
                           (format #t
                                   "Issued SIGHUP to Service MPD (PID ~a)."
                                   pid))
+                        (format #t "Service MPD is not running.")))))
+              (shepherd-action
+               (name 'update)
+               (documentation "Request MPD to update its music database.")
+               (procedure
+                #~(lambda (pid)
+                    (if pid
+                        (begin
+                          (invoke #$(file-append mpd-mpc "/bin/mpc") "update")
+                          (format #t "Database update requested for service \
+MPD (PID ~a)." pid))
                         (format #t "Service MPD is not running.")))))))))))
 
 (define (mpd-accounts config)
-- 
2.39.2





This bug report was last modified 1 year and 358 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.