Subject: [PATCH v3 3/3] gnu: speakersafetyd: Add log file.

From: Roman Scherer <[email-masked]>
Date: Wed, 9 Apr 2025 19:26:11 +0200

* gnu/services/sound.scm (speakersafetyd): Add log file.

Change-Id: I870bc7bfd69249da3a9c981f627e751395386bd2
---
 doc/guix.texi          | 3 +++
 gnu/services/sound.scm | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 6acbf1ba55..60a82081d4 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -27270,6 +27270,9 @@ Sound Services
 @item @code{group} (default: @code{"speakersafetyd"}) (type: string)
 The group to run the Speaker Safety Daemon as.
 
+@item @code{log-file} (default: @code{"/var/log/speakersafetyd.log"}) (type: string)
+The file name to the Speaker Safety Daemon log file.
+
 @item @code{maximum-gain-reduction} (default: @code{7}) (type: integer)
 Maximum gain reduction before panicking, useful for debugging.
 
diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm
index 0558d4fce8..23f92f6bee 100644
--- a/gnu/services/sound.scm
+++ b/gnu/services/sound.scm
@@ -293,6 +293,9 @@ (define-configuration/no-serialization speakersafetyd-configuration
   (group
    (string "speakersafetyd")
    "The group to run the Speaker Safety Daemon as.")
+  (log-file
+   (string "/var/log/speakersafetyd.log")
+   "The file name to the Speaker Safety Daemon log file.")
   (maximum-gain-reduction
    (integer 7)
    "Maximum gain reduction before panicking, useful for debugging.")
@@ -332,7 +335,7 @@ (define speakersafetyd-activation
 
 (define speakersafetyd-shepherd-service
   (match-record-lambda <speakersafetyd-configuration>
-      ( blackbox-directory configuration-directory group
+      ( blackbox-directory configuration-directory group log-file
         maximum-gain-reduction speakersafetyd user)
     (shepherd-service
      (documentation "Run the speaker safety daemon")
@@ -344,6 +347,7 @@ (define speakersafetyd-shepherd-service
                      "--blackbox-path" #$blackbox-directory
                      "--max-reduction" (number->string #$maximum-gain-reduction))
                #:group #$group
+               #:log-file #$log-file
                #:supplementary-groups '("audio")
                #:user #$user))
      (stop #~(make-kill-destructor)))))
-- 
2.49.0