[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63082: [PATCH v2 01/16] services: mpd: Add an 'update' action to tri
From: |
Maxim Cournoyer |
Subject: |
bug#63082: [PATCH v2 01/16] services: mpd: Add an 'update' action to trigger a database update. |
Date: |
Sat, 29 Apr 2023 13:21:38 -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 bdacb56af5..f8acdbd6b5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -33546,6 +33546,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
- bug#63082: [PATCH 14/17] services: mpd: Obsolete 'environment-variables' field., (continued)
bug#63082: [PATCH 07/17] services: mpd: Log to syslog by default., Maxim Cournoyer, 2023/04/28
bug#63082: [PATCH 17/17] services: Avoid 'delete' overrides warning in audio module., Maxim Cournoyer, 2023/04/28
bug#63082: [PATCH v2 00/16] Improve out-of-the-box experience with mpd-service-type, Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 03/16] services: mpd: Rename %set-user-group to set-user-group., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 01/16] services: mpd: Add an 'update' action to trigger a database update.,
Maxim Cournoyer <=
- bug#63082: [PATCH v2 06/16] services: mpd; Refactor start slot directory initialization., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 02/16] services: mpd: Streamline mpd-user-sanitizer and mympd-user-sanitizer., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 04/16] services: mpd: Obsolete the 'group' field., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 05/16] services: mpd: List log-level in decreasing verbosity order in doc., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 11/16] services: mpd: Warn when the MPD user is not in the "audio" group., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 08/16] services: mpd: Do not rotate logs when using syslog., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 07/16] services: mpd: Log to syslog by default., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 12/16] services: mpd: Auto-detect mpd-output mixer type by default., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 09/16] services: mpd: Let Shepherd effect the user/group change., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 10/16] system: accounts: Export <user-account>., Maxim Cournoyer, 2023/04/29