unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Dariqq <dariqq@posteo.net>
To: 73383@debbugs.gnu.org
Cc: Dariqq <dariqq@posteo.net>
Subject: [bug#73383] [PATCH v2 1/2] home: home-shepherd-configuration: Add silent? field.
Date: Fri, 11 Oct 2024 08:39:08 +0000	[thread overview]
Message-ID: <604543b7f28f26505e5449b0dc6e46a52c6e325b.1728634996.git.dariqq@posteo.net> (raw)
In-Reply-To: <cover.1728634996.git.dariqq@posteo.net>

* gnu/home/services/shepherd.scm (home-shepherd-configuration): Add silent? field.
(launch-shepherd-gexp): Conditionally invoke shepherd with --silent.
* doc/guix.texi (home-shepherd-configuration): Document it.

Change-Id: I1ce7a92c2777ebded39fe293b0bdcbd03562b4fc
---
 doc/guix.texi                  | 4 ++++
 gnu/home/services/shepherd.scm | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 8f3b8ef6cd..10d4214563 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -46071,6 +46071,10 @@ Shepherd Home Service
 @item auto-start? (default: @code{#t})
 Whether or not to start Shepherd on first login.
 
+@item silent? (default: @code{#t})
+When true, the @command{shepherd} process does not write
+anything to standard output when started automatically.
+
 @item services (default: @code{'()})
 A list of @code{<shepherd-service>} to start.
 You should probably use the service extension
diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm
index dfe4030a4e..75b80bfa26 100644
--- a/gnu/home/services/shepherd.scm
+++ b/gnu/home/services/shepherd.scm
@@ -32,6 +32,7 @@ (define-module (gnu home services shepherd)
             home-shepherd-configuration?
             home-shepherd-configuration-shepherd
             home-shepherd-configuration-auto-start?
+            home-shepherd-configuration-silent?
             home-shepherd-configuration-services)
   #:re-export (shepherd-service
                shepherd-service?
@@ -58,6 +59,8 @@ (define-record-type* <home-shepherd-configuration>
                (default #t))
   (daemonize? home-shepherd-configuration-daemonize?
               (default #t))
+  (silent? home-shepherd-configuration-silent?
+            (default #t))
   (services home-shepherd-configuration-services
             (default '())))
 
@@ -107,7 +110,8 @@ (define (home-shepherd-configuration-file config)
     (scheme-file "shepherd.conf" config)))
 
 (define (launch-shepherd-gexp config)
-  (let* ((shepherd (home-shepherd-configuration-shepherd config)))
+  (let* ((shepherd (home-shepherd-configuration-shepherd config))
+         (silent? (home-shepherd-configuration-silent? config)))
     (if (home-shepherd-configuration-auto-start? config)
         (with-imported-modules '((guix build utils))
           #~(unless (file-exists?
@@ -125,6 +129,7 @@ (define (launch-shepherd-gexp config)
                  #$(file-append shepherd "/bin/shepherd")
                  "--logfile"
                  (string-append log-dir "/shepherd.log")
+                 #$@(if silent? '("--silent") '())
                  "--config"
                  #$(home-shepherd-configuration-file config)))))
         #~"")))
-- 
2.46.0





  reply	other threads:[~2024-10-11  8:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20 12:39 [bug#73383] [PATCH] home: home-shepherd-configuration: Add silent? field Dariqq
2024-09-25 15:57 ` Ludovic Courtès
2024-09-27 14:06   ` Dariqq
2024-10-11  8:39 ` [bug#73383] [PATCH v2 0/2] home-shepherd-configuration: add silent? and document daemonize? Dariqq
2024-10-11  8:39   ` Dariqq [this message]
2024-10-11  8:39   ` [bug#73383] [PATCH v2 2/2] doc: Document home-shepherd-configuration-daemonize? Dariqq
2024-10-14 11:07   ` bug#73383: [PATCH v2 0/2] home-shepherd-configuration: add silent? and document daemonize? Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=604543b7f28f26505e5449b0dc6e46a52c6e325b.1728634996.git.dariqq@posteo.net \
    --to=dariqq@posteo.net \
    --cc=73383@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).