all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#71118] [PATCH 0/5] More service logging to stderr
@ 2024-05-22 14:04 Ludovic Courtès
  2024-05-22 14:53 ` [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f Ludovic Courtès
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Ludovic Courtès @ 2024-05-22 14:04 UTC (permalink / raw)
  To: 71118; +Cc: Ludovic Courtès

Hello,

This changes a few core services to log to stderr rather than
syslog, in light of the improvements made for the upcoming
Shepherd 1.0: ‘herd status’ displaying recently logged messages,
and built-in log rotation.

Thoughts?

Ludo’.

Ludovic Courtès (5):
  services: nscd: ‘log-file’ defaults to #f.
  services: tor: Log to stderr rather than syslog.
  services: dbus: Log to stderr rather than syslog.
  services: avahi: Use socket activation and log to stderr.
  services: darkstat: Depend on ‘user-processes’.

 doc/guix.texi               |  8 +++++---
 gnu/services/avahi.scm      | 14 +++++++++-----
 gnu/services/base.scm       |  2 +-
 gnu/services/dbus.scm       |  8 ++++----
 gnu/services/monitoring.scm |  2 +-
 gnu/services/networking.scm |  5 +----
 6 files changed, 21 insertions(+), 18 deletions(-)


base-commit: 9c3a8a380bcfebdb77af61532e7bfec523d7bde8
-- 
2.41.0





^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f.
  2024-05-22 14:04 [bug#71118] [PATCH 0/5] More service logging to stderr Ludovic Courtès
@ 2024-05-22 14:53 ` Ludovic Courtès
  2024-05-22 17:22   ` Maxim Cournoyer
  2024-05-22 17:25   ` Maxim Cournoyer
  2024-05-22 14:53 ` [bug#71118] [PATCH 2/5] services: tor: Log to stderr rather than syslog Ludovic Courtès
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 17+ messages in thread
From: Ludovic Courtès @ 2024-05-22 14:53 UTC (permalink / raw)
  To: 71118
  Cc: Ludovic Courtès, Florian Pelz, Ludovic Courtès,
	Matthew Trzcinski, Maxim Cournoyer

* gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f.
* doc/guix.texi (Base Services): Clarify documentation.

Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4
---
 doc/guix.texi         | 8 +++++---
 gnu/services/base.scm | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 8073e3f6d49..0055724e658 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19446,9 +19446,11 @@ Base Services
 Package object denoting the GNU C Library providing the @command{nscd}
 command.
 
-@item @code{log-file} (default: @code{"/var/log/nscd.log"})
-Name of the nscd log file.  This is where debugging output goes when
-@code{debug-level} is strictly positive.
+@item @code{log-file} (default: @code{#f})
+Name of the nscd log file.  Debugging output goes to that file when
+@code{debug-level} is strictly positive, or to standard error if it is
+@code{#f}.  Regular messages are written to syslog when
+@code{debug-level} is zero, regardless of the value of @code{log-file}.
 
 @item @code{debug-level} (default: @code{0})
 Integer denoting the debugging levels.  Higher numbers mean that more
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 85160bd3abb..984670cd32c 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1285,7 +1285,7 @@ (define-record-type* <nscd-configuration> nscd-configuration
   make-nscd-configuration
   nscd-configuration?
   (log-file    nscd-configuration-log-file        ;string
-               (default "/var/log/nscd.log"))
+               (default #f))
   (debug-level nscd-debug-level                   ;integer
                (default 0))
   ;; TODO: See nscd.conf in glibc for other options to add.
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 2/5] services: tor: Log to stderr rather than syslog.
  2024-05-22 14:04 [bug#71118] [PATCH 0/5] More service logging to stderr Ludovic Courtès
  2024-05-22 14:53 ` [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f Ludovic Courtès
@ 2024-05-22 14:53 ` Ludovic Courtès
  2024-05-22 17:28   ` Maxim Cournoyer
  2024-05-22 14:53 ` [bug#71118] [PATCH 3/5] services: dbus: " Ludovic Courtès
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2024-05-22 14:53 UTC (permalink / raw)
  To: 71118; +Cc: Ludovic Courtès

* gnu/services/networking.scm (tor-configuration->torrc): Change ‘Log’
directive to ‘stderr’.
(tor-shepherd-service): Remove /dev/log file system mapping.

Change-Id: I2e33ad8033f884ce59d929a4181172325331efe0
---
 gnu/services/networking.scm | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 8e64e529abf..378e117a869 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -1001,7 +1001,7 @@ (define (tor-configuration->torrc config)
                (display "\
 ### These lines were generated from your system configuration:
 DataDirectory /var/lib/tor
-Log notice syslog\n" port)
+Log notice stderr\n" port)
                (when (eq? 'unix '#$socks-socket-type)
                  (display "\
 SocksPort unix:/var/run/tor/socks-sock
@@ -1046,9 +1046,6 @@ (define (tor-shepherd-service config)
                                    (source "/var/lib/tor")
                                    (target source)
                                    (writable? #t))
-                                  (file-system-mapping
-                                   (source "/dev/log") ;for syslog
-                                   (target source))
                                   (file-system-mapping
                                    (source "/var/run/tor")
                                    (target source)
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 3/5] services: dbus: Log to stderr rather than syslog.
  2024-05-22 14:04 [bug#71118] [PATCH 0/5] More service logging to stderr Ludovic Courtès
  2024-05-22 14:53 ` [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f Ludovic Courtès
  2024-05-22 14:53 ` [bug#71118] [PATCH 2/5] services: tor: Log to stderr rather than syslog Ludovic Courtès
@ 2024-05-22 14:53 ` Ludovic Courtès
  2024-05-22 17:30   ` Maxim Cournoyer
  2024-05-22 14:53 ` [bug#71118] [PATCH 4/5] services: avahi: Use socket activation and log to stderr Ludovic Courtès
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2024-05-22 14:53 UTC (permalink / raw)
  To: 71118; +Cc: Ludovic Courtès

* gnu/services/dbus.scm (dbus-shepherd-service): Remove ‘--syslog-only’
option and pass #:log-file unconditionally.

Change-Id: I9e42f241e08b95ff01e9ad69551bc2c7ce869d6d
---
 gnu/services/dbus.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index 8dee91a3f7b..1e1380185a4 100644
--- a/gnu/services/dbus.scm
+++ b/gnu/services/dbus.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013-2017, 2019-2021, 2024 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
@@ -234,12 +234,12 @@ (define dbus-shepherd-service
             (requirement '(user-processes syslogd))
             (start #~(make-forkexec-constructor
                       (list (string-append #$dbus "/bin/dbus-daemon")
-                            "--nofork" "--system" "--syslog-only")
+                            "--nofork" "--system")
+                      #:log-file "/var/log/dbus-daemon.log"
                       #$@(if verbose?
                              ;; Since the verbose output goes to the console,
                              ;; not syslog, add a log file to capture it.
-                             '(#:environment-variables '("DBUS_VERBOSE=1")
-                               #:log-file "/var/log/dbus-daemon.log")
+                             '(#:environment-variables '("DBUS_VERBOSE=1"))
                              '())
                       #:pid-file "/run/dbus/pid"))
             (stop #~(make-kill-destructor)))))))
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 4/5] services: avahi: Use socket activation and log to stderr.
  2024-05-22 14:04 [bug#71118] [PATCH 0/5] More service logging to stderr Ludovic Courtès
                   ` (2 preceding siblings ...)
  2024-05-22 14:53 ` [bug#71118] [PATCH 3/5] services: dbus: " Ludovic Courtès
@ 2024-05-22 14:53 ` Ludovic Courtès
  2024-05-22 14:53 ` [bug#71118] [PATCH 5/5] services: darkstat: Depend on ‘user-processes’ Ludovic Courtès
  2024-05-24 12:46 ` [bug#71118] [PATCH 0/5] More service logging to stderr Maxim Cournoyer
  5 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2024-05-22 14:53 UTC (permalink / raw)
  To: 71118; +Cc: Ludovic Courtès

* gnu/services/avahi.scm (avahi-shepherd-service): Change to systemd
style.  Remove ‘--daemonize’ option and #:pid-file.  Add #:lazy-start?
and #:log-file.

Change-Id: I1915243f057ff3bbe281f46f17826f24b124f659
---
 gnu/services/avahi.scm | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/gnu/services/avahi.scm b/gnu/services/avahi.scm
index 1c4220e490b..9352492bbda 100644
--- a/gnu/services/avahi.scm
+++ b/gnu/services/avahi.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014-2020, 2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014-2020, 2022, 2024 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -131,13 +131,17 @@ (define (avahi-shepherd-service config)
            (provision '(avahi-daemon))
            (requirement '(user-processes dbus-system networking))
 
-           (start #~(make-forkexec-constructor
+           (start #~(make-systemd-constructor
                      (list #$(file-append avahi "/sbin/avahi-daemon")
-                           "--daemonize"
                            #$@(if debug? #~("--debug") #~())
                            "-f" #$config)
-                     #:pid-file "/run/avahi-daemon/pid"))
-           (stop #~(make-kill-destructor))
+                     (list (endpoint
+                            (make-socket-address
+                             AF_UNIX
+                             "/run/avahi-daemon/socket")))
+                     #:lazy-start? #f
+                     #:log-file "/var/log/avahi-daemon.log"))
+           (stop #~(make-systemd-destructor))
            (actions (list (shepherd-configuration-action config)))))))
 
 (define avahi-service-type
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 5/5] services: darkstat: Depend on ‘user-processes’.
  2024-05-22 14:04 [bug#71118] [PATCH 0/5] More service logging to stderr Ludovic Courtès
                   ` (3 preceding siblings ...)
  2024-05-22 14:53 ` [bug#71118] [PATCH 4/5] services: avahi: Use socket activation and log to stderr Ludovic Courtès
@ 2024-05-22 14:53 ` Ludovic Courtès
  2024-05-22 17:30   ` Maxim Cournoyer
  2024-05-24 12:46 ` [bug#71118] [PATCH 0/5] More service logging to stderr Maxim Cournoyer
  5 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2024-05-22 14:53 UTC (permalink / raw)
  To: 71118; +Cc: Ludovic Courtès

* gnu/services/monitoring.scm (darkstat-shepherd-service): Add
‘user-processes’ to ‘requirement’.

Change-Id: I6abaefd88c6075a0379e5867838653765dfaa08e
---
 gnu/services/monitoring.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm
index e698040078e..0a93c907eea 100644
--- a/gnu/services/monitoring.scm
+++ b/gnu/services/monitoring.scm
@@ -132,7 +132,7 @@ (define darkstat-shepherd-service
      (shepherd-service
       (documentation "Network statistics gatherer.")
       (provision '(darkstat))
-      (requirement '(networking))
+      (requirement '(user-processes networking))
       (start #~(make-forkexec-constructor
                 (list #$(file-append package "/sbin/darkstat")
                       "-i" #$interface
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f.
  2024-05-22 14:53 ` [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f Ludovic Courtès
@ 2024-05-22 17:22   ` Maxim Cournoyer
  2024-05-23  9:26     ` Ludovic Courtès
  2024-05-22 17:25   ` Maxim Cournoyer
  1 sibling, 1 reply; 17+ messages in thread
From: Maxim Cournoyer @ 2024-05-22 17:22 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 71118, Matthew Trzcinski, Florian Pelz

Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> * gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f.
> * doc/guix.texi (Base Services): Clarify documentation.
>
> Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4
> ---
>  doc/guix.texi         | 8 +++++---
>  gnu/services/base.scm | 2 +-
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 8073e3f6d49..0055724e658 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -19446,9 +19446,11 @@ Base Services
>  Package object denoting the GNU C Library providing the @command{nscd}
>  command.
>  
> -@item @code{log-file} (default: @code{"/var/log/nscd.log"})
> -Name of the nscd log file.  This is where debugging output goes when
> -@code{debug-level} is strictly positive.
> +@item @code{log-file} (default: @code{#f})
> +Name of the nscd log file.  Debugging output goes to that file when
> +@code{debug-level} is strictly positive, or to standard error if it is
> +@code{#f}.  Regular messages are written to syslog when
> +@code{debug-level} is zero, regardless of the value of @code{log-file}.

Is it not a bit counter-intuitive, to have a 'log-file' field that users
can set, but debug logs not going there?  Perhaps we should get rid of
it entirely instead?

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f.
  2024-05-22 14:53 ` [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f Ludovic Courtès
  2024-05-22 17:22   ` Maxim Cournoyer
@ 2024-05-22 17:25   ` Maxim Cournoyer
  1 sibling, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-05-22 17:25 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 71118, Matthew Trzcinski, Florian Pelz

Hi Ludo,

Ludovic Courtès <ludo@gnu.org> writes:

> * gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f.
> * doc/guix.texi (Base Services): Clarify documentation.
>
> Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4
> ---
>  doc/guix.texi         | 8 +++++---
>  gnu/services/base.scm | 2 +-
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 8073e3f6d49..0055724e658 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -19446,9 +19446,11 @@ Base Services
>  Package object denoting the GNU C Library providing the @command{nscd}
>  command.
>  
> -@item @code{log-file} (default: @code{"/var/log/nscd.log"})
> -Name of the nscd log file.  This is where debugging output goes when
> -@code{debug-level} is strictly positive.
> +@item @code{log-file} (default: @code{#f})
> +Name of the nscd log file.  Debugging output goes to that file when
> +@code{debug-level} is strictly positive, or to standard error if it is
> +@code{#f}.  Regular messages are written to syslog when
> +@code{debug-level} is zero, regardless of the value of @code{log-file}.

My initial reading of the above was wrong.  I guess it's fine, though I
find the special case logging to /dev/error when debug-level == 0
despite log-file being set a bit surprising still.

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 2/5] services: tor: Log to stderr rather than syslog.
  2024-05-22 14:53 ` [bug#71118] [PATCH 2/5] services: tor: Log to stderr rather than syslog Ludovic Courtès
@ 2024-05-22 17:28   ` Maxim Cournoyer
  2024-05-23  9:24     ` Ludovic Courtès
  0 siblings, 1 reply; 17+ messages in thread
From: Maxim Cournoyer @ 2024-05-22 17:28 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 71118

Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> * gnu/services/networking.scm (tor-configuration->torrc): Change ‘Log’
> directive to ‘stderr’.
> (tor-shepherd-service): Remove /dev/log file system mapping.
>
> Change-Id: I2e33ad8033f884ce59d929a4181172325331efe0
> ---
>  gnu/services/networking.scm | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
> index 8e64e529abf..378e117a869 100644
> --- a/gnu/services/networking.scm
> +++ b/gnu/services/networking.scm
> @@ -1001,7 +1001,7 @@ (define (tor-configuration->torrc config)
>                 (display "\
>  ### These lines were generated from your system configuration:
>  DataDirectory /var/lib/tor
> -Log notice syslog\n" port)
> +Log notice stderr\n" port)
>                 (when (eq? 'unix '#$socks-socket-type)
>                   (display "\
>  SocksPort unix:/var/run/tor/socks-sock
> @@ -1046,9 +1046,6 @@ (define (tor-shepherd-service config)
>                                     (source "/var/lib/tor")
>                                     (target source)
>                                     (writable? #t))
> -                                  (file-system-mapping
> -                                   (source "/dev/log") ;for syslog
> -                                   (target source))

I see no functional change here; do I understand that Shepherd 1.0 will
now log (by default?) to /dev/error (stderr) instead of /dev/log
(syslog)?  What is the rationale for such change?

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 3/5] services: dbus: Log to stderr rather than syslog.
  2024-05-22 14:53 ` [bug#71118] [PATCH 3/5] services: dbus: " Ludovic Courtès
@ 2024-05-22 17:30   ` Maxim Cournoyer
  0 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-05-22 17:30 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 71118

Hello,

Ludovic Courtès <ludo@gnu.org> writes:

> * gnu/services/dbus.scm (dbus-shepherd-service): Remove ‘--syslog-only’
> option and pass #:log-file unconditionally.
>
> Change-Id: I9e42f241e08b95ff01e9ad69551bc2c7ce869d6d
> ---
>  gnu/services/dbus.scm | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
> index 8dee91a3f7b..1e1380185a4 100644
> --- a/gnu/services/dbus.scm
> +++ b/gnu/services/dbus.scm
> @@ -1,5 +1,5 @@
>  ;;; GNU Guix --- Functional package management for GNU
> -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2013-2017, 2019-2021, 2024 Ludovic Courtès <ludo@gnu.org>
>  ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
>  ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
>  ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
> @@ -234,12 +234,12 @@ (define dbus-shepherd-service
>              (requirement '(user-processes syslogd))
>              (start #~(make-forkexec-constructor
>                        (list (string-append #$dbus "/bin/dbus-daemon")
> -                            "--nofork" "--system" "--syslog-only")
> +                            "--nofork" "--system")
> +                      #:log-file "/var/log/dbus-daemon.log"
>                        #$@(if verbose?
>                               ;; Since the verbose output goes to the console,
>                               ;; not syslog, add a log file to capture it.
> -                             '(#:environment-variables '("DBUS_VERBOSE=1")
> -                               #:log-file "/var/log/dbus-daemon.log")
> +                             '(#:environment-variables '("DBUS_VERBOSE=1"))
>                               '())
>                        #:pid-file "/run/dbus/pid"))
>              (stop #~(make-kill-destructor)))))))

How does logging to a file instead of to /dev/log help Shepherd
producing better output?  Does it read the log file?  If so, couldn't it read
syslog as well?

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 5/5] services: darkstat: Depend on ‘user-processes’.
  2024-05-22 14:53 ` [bug#71118] [PATCH 5/5] services: darkstat: Depend on ‘user-processes’ Ludovic Courtès
@ 2024-05-22 17:30   ` Maxim Cournoyer
  0 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-05-22 17:30 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 71118

Ludovic Courtès <ludo@gnu.org> writes:

> * gnu/services/monitoring.scm (darkstat-shepherd-service): Add
> ‘user-processes’ to ‘requirement’.
>
> Change-Id: I6abaefd88c6075a0379e5867838653765dfaa08e

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail>

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 2/5] services: tor: Log to stderr rather than syslog.
  2024-05-22 17:28   ` Maxim Cournoyer
@ 2024-05-23  9:24     ` Ludovic Courtès
  2024-05-24 12:44       ` Maxim Cournoyer
  0 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2024-05-23  9:24 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 71118

Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> * gnu/services/networking.scm (tor-configuration->torrc): Change ‘Log’
>> directive to ‘stderr’.
>> (tor-shepherd-service): Remove /dev/log file system mapping.
>>
>> Change-Id: I2e33ad8033f884ce59d929a4181172325331efe0

[...]

> I see no functional change here; do I understand that Shepherd 1.0 will
> now log (by default?) to /dev/error (stderr) instead of /dev/log
> (syslog)?  What is the rationale for such change?

Shepherd by itself doesn’t make any decision; it’s up to the service to
choose whether to log to stdout/stderr or to syslog.

As I wrote in the cover letter at <https://issues.guix.gnu.org/71118>,
Shepherd 0.10 already does a good job at handling logs, which makes
gives less of an incentive to use syslogd; on top of that, 1.0 (current
‘devel’ branch) can display messages logged to stderr/stdout directly at
the command line:

--8<---------------cut here---------------start------------->8---
$ sudo /run/current-system/profile/bin/herd status guix-publish
Status of guix-publish:
  It is running since Tue 21 May 2024 08:44:57 AM CEST (2 days ago).
  PID 518 running: /gnu/store/12jb83hlngklkymn52yzaw7kldr2qiwp-guix-1.4.0-20.37719d3/bin/guix publish -u guix-publish -p 8123 -C zstd:3 -C gzip:3 --nar-path=nar --listen=0.0.0.0 --advertise
  It is enabled.
  Provides (guix-publish).
  Requires (user-processes guix-daemon avahi-daemon).
  Will be respawned.
  Log file: /var/log/guix-publish.log.

Recent messages:
  2024-05-21 10:56:10 In web/request.scm:
  2024-05-21 10:56:10    205:32  4 (read-request #<closed: file 7f5f48418af0> _)
  2024-05-21 10:56:10 In web/http.scm:
  2024-05-21 10:56:10   1158:12  3 (read-request-line _)
  2024-05-21 10:56:10    1066:2  2 (parse-request-uri _ _ _)
  2024-05-21 10:56:10 In ice-9/boot-9.scm:
  2024-05-21 10:56:10   1685:16  1 (raise-exception _ #:continuable? _)
  2024-05-21 10:56:10   1685:16  0 (raise-exception _ #:continuable? _)
  2024-05-21 10:56:10 .Bad request: Invalid URI: 85.94.204.153:31204
  2024-05-21 10:56:10 
--8<---------------cut here---------------end--------------->8---

It’s a slight quality-of-life improvement.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f.
  2024-05-22 17:22   ` Maxim Cournoyer
@ 2024-05-23  9:26     ` Ludovic Courtès
  2024-05-24 12:45       ` Maxim Cournoyer
  0 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2024-05-23  9:26 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 71118, Matthew Trzcinski, Florian Pelz

Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> * gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f.
>> * doc/guix.texi (Base Services): Clarify documentation.
>>
>> Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4

[...]

>> +@item @code{log-file} (default: @code{#f})
>> +Name of the nscd log file.  Debugging output goes to that file when
>> +@code{debug-level} is strictly positive, or to standard error if it is
>> +@code{#f}.  Regular messages are written to syslog when
>> +@code{debug-level} is zero, regardless of the value of @code{log-file}.
>
> Is it not a bit counter-intuitive, to have a 'log-file' field that users
> can set, but debug logs not going there?

Yeah, I had to check the code of nscd in libc, and it’s this weird.

> Perhaps we should get rid of it entirely instead?

I’d rather keep it to avoid gratuitous breakage and also because it’s
occasionally useful when one needs to debug NSS/nscd issues.

Ludo’.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 2/5] services: tor: Log to stderr rather than syslog.
  2024-05-23  9:24     ` Ludovic Courtès
@ 2024-05-24 12:44       ` Maxim Cournoyer
  0 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-05-24 12:44 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 71118

Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>> * gnu/services/networking.scm (tor-configuration->torrc): Change ‘Log’
>>> directive to ‘stderr’.
>>> (tor-shepherd-service): Remove /dev/log file system mapping.
>>>
>>> Change-Id: I2e33ad8033f884ce59d929a4181172325331efe0
>
> [...]
>
>> I see no functional change here; do I understand that Shepherd 1.0 will
>> now log (by default?) to /dev/error (stderr) instead of /dev/log
>> (syslog)?  What is the rationale for such change?
>
> Shepherd by itself doesn’t make any decision; it’s up to the service to
> choose whether to log to stdout/stderr or to syslog.

I see.

> As I wrote in the cover letter at <https://issues.guix.gnu.org/71118>,
> Shepherd 0.10 already does a good job at handling logs, which makes
> gives less of an incentive to use syslogd; on top of that, 1.0 (current
> ‘devel’ branch) can display messages logged to stderr/stdout directly at
> the command line:
>
> $ sudo /run/current-system/profile/bin/herd status guix-publish
> Status of guix-publish:
>   It is running since Tue 21 May 2024 08:44:57 AM CEST (2 days ago).
>   PID 518 running: /gnu/store/12jb83hlngklkymn52yzaw7kldr2qiwp-guix-1.4.0-20.37719d3/bin/guix publish -u guix-publish -p 8123 -C zstd:3 -C gzip:3 --nar-path=nar --listen=0.0.0.0 --advertise
>   It is enabled.
>   Provides (guix-publish).
>   Requires (user-processes guix-daemon avahi-daemon).
>   Will be respawned.
>   Log file: /var/log/guix-publish.log.
>
> Recent messages:
>   2024-05-21 10:56:10 In web/request.scm:
>   2024-05-21 10:56:10    205:32  4 (read-request #<closed: file 7f5f48418af0> _)
>   2024-05-21 10:56:10 In web/http.scm:
>   2024-05-21 10:56:10   1158:12  3 (read-request-line _)
>   2024-05-21 10:56:10    1066:2  2 (parse-request-uri _ _ _)
>   2024-05-21 10:56:10 In ice-9/boot-9.scm:
>   2024-05-21 10:56:10   1685:16  1 (raise-exception _ #:continuable? _)
>   2024-05-21 10:56:10   1685:16  0 (raise-exception _ #:continuable? _)
>   2024-05-21 10:56:10 .Bad request: Invalid URI: 85.94.204.153:31204
>   2024-05-21 10:56:10 
>
> It’s a slight quality-of-life improvement.

I agree that's more convenient than grepping /var/log/messages.

Thanks for explaining and for the Shepherd improvements!

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f.
  2024-05-23  9:26     ` Ludovic Courtès
@ 2024-05-24 12:45       ` Maxim Cournoyer
  0 siblings, 0 replies; 17+ messages in thread
From: Maxim Cournoyer @ 2024-05-24 12:45 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 71118, Matthew Trzcinski, Florian Pelz

Hi,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>> * gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f.
>>> * doc/guix.texi (Base Services): Clarify documentation.
>>>
>>> Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4
>
> [...]
>
>>> +@item @code{log-file} (default: @code{#f})
>>> +Name of the nscd log file.  Debugging output goes to that file when
>>> +@code{debug-level} is strictly positive, or to standard error if it is
>>> +@code{#f}.  Regular messages are written to syslog when
>>> +@code{debug-level} is zero, regardless of the value of @code{log-file}.
>>
>> Is it not a bit counter-intuitive, to have a 'log-file' field that users
>> can set, but debug logs not going there?
>
> Yeah, I had to check the code of nscd in libc, and it’s this weird.

Haha!

>> Perhaps we should get rid of it entirely instead?
>
> I’d rather keep it to avoid gratuitous breakage and also because it’s
> occasionally useful when one needs to debug NSS/nscd issues.

OK.  Sounds reasonable.  I didn't know the weirdness was carried from
the underlying software rather than our own.

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#71118] [PATCH 0/5] More service logging to stderr
  2024-05-22 14:04 [bug#71118] [PATCH 0/5] More service logging to stderr Ludovic Courtès
                   ` (4 preceding siblings ...)
  2024-05-22 14:53 ` [bug#71118] [PATCH 5/5] services: darkstat: Depend on ‘user-processes’ Ludovic Courtès
@ 2024-05-24 12:46 ` Maxim Cournoyer
  2024-06-02 18:57   ` bug#71118: " Ludovic Courtès
  5 siblings, 1 reply; 17+ messages in thread
From: Maxim Cournoyer @ 2024-05-24 12:46 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 71118

Hello,

Ludovic Courtès <ludo@gnu.org> writes:

> Hello,
>
> This changes a few core services to log to stderr rather than
> syslog, in light of the improvements made for the upcoming
> Shepherd 1.0: ‘herd status’ displaying recently logged messages,
> and built-in log rotation.
>
> Thoughts?
>
> Ludo’.
>
> Ludovic Courtès (5):
>   services: nscd: ‘log-file’ defaults to #f.
>   services: tor: Log to stderr rather than syslog.
>   services: dbus: Log to stderr rather than syslog.
>   services: avahi: Use socket activation and log to stderr.
>   services: darkstat: Depend on ‘user-processes’.
>

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail>

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#71118: [PATCH 0/5] More service logging to stderr
  2024-05-24 12:46 ` [bug#71118] [PATCH 0/5] More service logging to stderr Maxim Cournoyer
@ 2024-06-02 18:57   ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2024-06-02 18:57 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 71118-done

Hi,

Pushed:

  20e7b892189 * services: darkstat: Depend on ‘user-processes’.
  3298ec0200a * services: avahi: Use socket activation and log to stderr.
  b9b0f0a995e * services: dbus: Log to stderr rather than syslog.
  49e9c9ec3e8 * services: tor: Log to stderr rather than syslog.
  8f0878da8d1 * services: nscd: ‘log-file’ defaults to #f.

Thanks for reviewing!

Ludo’.




^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-06-03  5:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22 14:04 [bug#71118] [PATCH 0/5] More service logging to stderr Ludovic Courtès
2024-05-22 14:53 ` [bug#71118] [PATCH 1/5] services: nscd: ‘log-file’ defaults to #f Ludovic Courtès
2024-05-22 17:22   ` Maxim Cournoyer
2024-05-23  9:26     ` Ludovic Courtès
2024-05-24 12:45       ` Maxim Cournoyer
2024-05-22 17:25   ` Maxim Cournoyer
2024-05-22 14:53 ` [bug#71118] [PATCH 2/5] services: tor: Log to stderr rather than syslog Ludovic Courtès
2024-05-22 17:28   ` Maxim Cournoyer
2024-05-23  9:24     ` Ludovic Courtès
2024-05-24 12:44       ` Maxim Cournoyer
2024-05-22 14:53 ` [bug#71118] [PATCH 3/5] services: dbus: " Ludovic Courtès
2024-05-22 17:30   ` Maxim Cournoyer
2024-05-22 14:53 ` [bug#71118] [PATCH 4/5] services: avahi: Use socket activation and log to stderr Ludovic Courtès
2024-05-22 14:53 ` [bug#71118] [PATCH 5/5] services: darkstat: Depend on ‘user-processes’ Ludovic Courtès
2024-05-22 17:30   ` Maxim Cournoyer
2024-05-24 12:46 ` [bug#71118] [PATCH 0/5] More service logging to stderr Maxim Cournoyer
2024-06-02 18:57   ` bug#71118: " Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.