GNU bug report logs - #73383
[PATCH] home: home-shepherd-configuration: Add silent? field.

Previous Next

Package: guix-patches;

Reported by: Dariqq <dariqq <at> posteo.net>

Date: Fri, 20 Sep 2024 13:04:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73383 in the body.
You can then email your comments to 73383 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to , guix-patches <at> gnu.org:
bug#73383; Package guix-patches. (Fri, 20 Sep 2024 13:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dariqq <dariqq <at> posteo.net>:
New bug report received and forwarded. Copy sent to , guix-patches <at> gnu.org. (Fri, 20 Sep 2024 13:04:02 GMT) Full text and rfc822 format available.

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

From: Dariqq <dariqq <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Dariqq <dariqq <at> posteo.net>
Subject: [PATCH] home: home-shepherd-configuration: Add silent? field.
Date: Fri, 20 Sep 2024 12:39:23 +0000
* 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
---

Hi,

This adds a configuration field to the home-shepherd to optionally invoke it
with --silent. See [1] for details. The option currently only actually works
as advertised when using the development branch of shepherd, for the current
version (v0.10.5) the --silent parameter is ignored.

I have set the default value to #f to not change the current behaviour.

For the documentation I am not perfectly happy with my description because the
behaviour is opposite of the description (Setting to #t causes no output to
stdout), maybe there is a better way to phrase this? Also is there a better way
to communicate that it only works when the auto-start? field is also #t?


Related: The daemonize? field is not documented and the accessor is not being
exported.

[1] https://issues.guix.gnu.org/72277


 doc/guix.texi                  | 3 +++
 gnu/home/services/shepherd.scm | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 52e36e4354..ab8cf54ae8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -46057,6 +46057,9 @@ Shepherd Home Service
 @item auto-start? (default: @code{#t})
 Whether or not to start Shepherd on first login.
 
+@item silent? (default: @code{#f})
+Whether or not the auto-started Shepherd should output to stdout.
+
 @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..17b005ed71 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 #f))
   (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)))))
         #~"")))

base-commit: e9d903f146865db5948abd271a5c7e763681b4e9
-- 
2.46.0





Information forwarded to guix-patches <at> gnu.org:
bug#73383; Package guix-patches. (Wed, 25 Sep 2024 15:59:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Dariqq <dariqq <at> posteo.net>
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>, 73383 <at> debbugs.gnu.org,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>, paren <at> disroot.org,
 Florian Pelz <pelzflorian <at> pelzflorian.de>, Andrew Tropin <andrew <at> trop.in>
Subject: Re: [bug#73383] [PATCH] home: home-shepherd-configuration: Add
 silent? field.
Date: Wed, 25 Sep 2024 17:57:10 +0200
Hi,

Dariqq <dariqq <at> posteo.net> skribis:

> * 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

[...]

> Related: The daemonize? field is not documented and the accessor is not being
> exported.

We should fix it.

> +@item silent? (default: @code{#f})
> +Whether or not the auto-started Shepherd should output to stdout.

Alternatively: “When true, the @command{shepherd} process does not write
anything to standard output.”

I would go as far as making it #t by default, WDYT?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#73383; Package guix-patches. (Fri, 27 Sep 2024 14:17:02 GMT) Full text and rfc822 format available.

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

From: Dariqq <dariqq <at> posteo.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>, 73383 <at> debbugs.gnu.org,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>, paren <at> disroot.org,
 Florian Pelz <pelzflorian <at> pelzflorian.de>, Andrew Tropin <andrew <at> trop.in>
Subject: Re: [bug#73383] [PATCH] home: home-shepherd-configuration: Add
 silent? field.
Date: Fri, 27 Sep 2024 14:06:16 +0000

On 25.09.24 17:57, Ludovic Courtès wrote:
> Hi,
> 
> Dariqq <dariqq <at> posteo.net> skribis:
> 
>> * 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
> 
> [...]
> 
>> Related: The daemonize? field is not documented and the accessor is not being
>> exported.
> 
> We should fix it.
> 
>> +@item silent? (default: @code{#f})
>> +Whether or not the auto-started Shepherd should output to stdout.
> 
> Alternatively: “When true, the @command{shepherd} process does not write
> anything to standard output.”

That sounds way better. I would also mention that this only does 
something when autostart? is also #t.
> 
> I would go as far as making it #t by default, WDYT?
> 
Personally I think these messages provide little value when they just 
inform me that all my home-services have started successfully 
(especially because this is also available in the log file anyway), so I 
would have no objection.

Not sure how others feel about them. Probably most dont see them at all 
when they launch directly into their de/wm.

> Thanks,
> Ludo’.





Information forwarded to , guix-patches <at> gnu.org:
bug#73383; Package guix-patches. (Fri, 11 Oct 2024 08:41:01 GMT) Full text and rfc822 format available.

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

From: Dariqq <dariqq <at> posteo.net>
To: 73383 <at> debbugs.gnu.org
Cc: Dariqq <dariqq <at> posteo.net>
Subject: [PATCH v2 0/2] home-shepherd-configuration: add silent? and document
 daemonize?
Date: Fri, 11 Oct 2024 08:39:07 +0000
Here is v2:

Changes:
 * Change default-value of the silent? field to #t.
 * Update the documentation. I added something that (hopefully) makes it obvious that the field is intended to be used together with the auto-start? field.
 * Added a second patch to document the daemonize? field and export the field-accessor. Should it warn about the issue when dameonize? is #f but auto-start? is #t blocking logins?

Dariqq (2):
  home: home-shepherd-configuration: Add silent? field.
  doc: Document home-shepherd-configuration-daemonize?

 doc/guix.texi                  | 7 +++++++
 gnu/home/services/shepherd.scm | 8 +++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)


base-commit: 99999ac8ebc4bd5c988ebc88461421aaf55e337a
-- 
2.46.0





Information forwarded to , guix-patches <at> gnu.org:
bug#73383; Package guix-patches. (Fri, 11 Oct 2024 08:41:02 GMT) Full text and rfc822 format available.

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

From: Dariqq <dariqq <at> posteo.net>
To: 73383 <at> debbugs.gnu.org
Cc: Dariqq <dariqq <at> posteo.net>
Subject: [PATCH v2 1/2] home: home-shepherd-configuration: Add silent? field.
Date: Fri, 11 Oct 2024 08:39:08 +0000
* 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





Information forwarded to , guix-patches <at> gnu.org:
bug#73383; Package guix-patches. (Fri, 11 Oct 2024 08:41:02 GMT) Full text and rfc822 format available.

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

From: Dariqq <dariqq <at> posteo.net>
To: 73383 <at> debbugs.gnu.org
Cc: Dariqq <dariqq <at> posteo.net>
Subject: [PATCH v2 2/2] doc: Document home-shepherd-configuration-daemonize?
Date: Fri, 11 Oct 2024 08:39:09 +0000
* gnu/home/services/shepherd.scm: Export home-shepherd-configuration-daemonize?.
* doc/guix.texi (home-shepherd-configuration): Add entry for daemonize? field.

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

diff --git a/doc/guix.texi b/doc/guix.texi
index 10d4214563..b786e1b022 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -46071,6 +46071,9 @@ Shepherd Home Service
 @item auto-start? (default: @code{#t})
 Whether or not to start Shepherd on first login.
 
+@item daemonize? (default: @code{#t})
+Whether or not to run Shepherd in the background.
+
 @item silent? (default: @code{#t})
 When true, the @command{shepherd} process does not write
 anything to standard output when started automatically.
diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm
index 75b80bfa26..5ea8462020 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-daemonize?
             home-shepherd-configuration-silent?
             home-shepherd-configuration-services)
   #:re-export (shepherd-service
-- 
2.46.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 14 Oct 2024 11:08:02 GMT) Full text and rfc822 format available.

Notification sent to Dariqq <dariqq <at> posteo.net>:
bug acknowledged by developer. (Mon, 14 Oct 2024 11:08:02 GMT) Full text and rfc822 format available.

Message #25 received at 73383-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Dariqq <dariqq <at> posteo.net>
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>, paren <at> disroot.org,
 Florian Pelz <pelzflorian <at> pelzflorian.de>, Andrew Tropin <andrew <at> trop.in>,
 73383-done <at> debbugs.gnu.org
Subject: Re: [bug#73383] [PATCH v2 0/2] home-shepherd-configuration: add
 silent? and document daemonize?
Date: Mon, 14 Oct 2024 13:07:00 +0200
Hello,

Dariqq <dariqq <at> posteo.net> skribis:

> Here is v2:
>
> Changes:
>  * Change default-value of the silent? field to #t.
>  * Update the documentation. I added something that (hopefully) makes it obvious that the field is intended to be used together with the auto-start? field.
>  * Added a second patch to document the daemonize? field and export the field-accessor. Should it warn about the issue when dameonize? is #f but auto-start? is #t blocking logins?
>
> Dariqq (2):
>   home: home-shepherd-configuration: Add silent? field.
>   doc: Document home-shepherd-configuration-daemonize?

Applied, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 11 Nov 2024 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 216 days ago.

Previous Next


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