GNU bug report logs - #76063
[PATCH 0/3] Switch to the Shepherd's system log

Previous Next

Package: guix-patches;

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

Date: Tue, 4 Feb 2025 22:54:02 UTC

Severity: normal

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 76063 in the body.
You can then email your comments to 76063 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 pelzflorian <at> pelzflorian.de, julien <at> lepiller.eu, guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Tue, 04 Feb 2025 22:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to pelzflorian <at> pelzflorian.de, julien <at> lepiller.eu, guix-patches <at> gnu.org. (Tue, 04 Feb 2025 22:54:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 0/3] Switch to the Shepherd's system log
Date: Tue,  4 Feb 2025 23:53:33 +0100
Hello,

This patch series switches Guix System from Inetutils’s ‘syslogd’
to the Shepherd’s ‘system-log’.  Quoth ‘news.scm’:

  The advantages of this change are the fact that @code{system-log} can start
  logging earlier after boot and stop shortly before shutdown, along with full
  integration with the rest of @command{shepherd}, in particular with the new
  @command{log-rotation} service.

Thoughts?

Ludo’.

Ludovic Courtès (3):
  services: Add ‘system-log’ Shepherd service.
  services: Switch to ‘shepherd-system-log-service-type’ in
    ‘%base-services’.
  DRAFT: news: Add entry for ‘system-log’ switch.

 doc/guix.texi             |  72 +++++++++++++++++++++++--
 etc/news.scm              |  16 +++++-
 gnu/services/base.scm     |   2 +-
 gnu/services/shepherd.scm | 108 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 192 insertions(+), 6 deletions(-)


base-commit: 285a1cb449f60798dc83f7f1016700b4ab2374a8
-- 
2.48.1





Information forwarded to ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Tue, 04 Feb 2025 22:59:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76063 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 1/3] services: Add ‘system-log’ Shepherd service.
Date: Tue,  4 Feb 2025 23:57:47 +0100
* gnu/services/shepherd.scm (gexp-or-integer?)
(gexp-or-string?, gexp-or-string-or-false?): New procedures.
(system-log-configuration): New record type.
(shepherd-system-log-service-type): New variable.
* doc/guix.texi (Shepherd Services): Document it.

Change-Id: I1e29fe0977eb4f8026ee6a2d2f282e269c8c00b4
---
 doc/guix.texi             |  55 +++++++++++++++++++
 gnu/services/shepherd.scm | 108 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 163 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index bb5f29277f..f52d79d549 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -45757,6 +45757,61 @@ Shepherd Services
 on the @code{timer} service.
 @end defvar
 
+@cindex system log service, from Shepherd
+@cindex syslogd, Shepherd system log service
+@defvar shepherd-system-log-service-type
+This service implements a @dfn{system log}, reading messages
+applications send to @file{/dev/log} and writing them to files or
+terminals according to user-defined rules.  It provides functionality
+traditionally implemented by @command{syslogd} programs.
+
+The value of services of this type must be a
+@code{system-log-configuration} record, as described below.
+@end defvar
+
+@c %start of fragment
+
+@deftp {Data Type} system-log-configuration
+Available @code{system-log-configuration} fields are:
+
+@table @asis
+@item @code{provision} (default: @code{(system-log syslogd)}) (type: list-of-symbols)
+The name(s) of the system log service.
+
+@item @code{requirement} (default: @code{(root-file-system)}) (type: list-of-symbols)
+Dependencies of the system log service.
+
+@item @code{kernel-log-file} (type: gexp-or-string-or-false)
+File from which kernel messages are read, @file{/dev/kmsg} by default.
+
+@item @code{message-destination} (default: @code{#f}) (type: gexp-or-false)
+This gexp must evaluate to a procedure that, when passed a log message,
+returns the list of files to write it to; @code{#f} is equivalent to
+using @code{(default-message-destination-procedure)}.  @pxref{System Log
+Service,,, shepherd,The GNU Shepherd Manual}, for information on how to
+write that procedure.
+
+@item @code{date-format} (type: gexp-or-string)
+String or string-valued gexp providing a specifying how to format
+timestamps in log file.  It must be a valid string for @code{strftime},
+including delimiting space---e.g., @code{"%c "} for a format identical
+to that of traditional syslogd implementations.
+
+@item @code{history-size} (type: gexp-or-integer)
+Number of logging messages kept in memory for the purposes of making
+them available to @command{herd status system-log}.
+
+@item @code{max-silent-time} (type: gexp-or-integer)
+Time after which a mark is written to log files if nothing was logged
+during that time frame.
+
+@end table
+
+@end deftp
+
+
+@c %end of fragment
+
 @defvar %shepherd-root-service
 This service represents PID <at> tie{}1.
 @end defvar
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 328bfbedff..bc31285cfb 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -31,6 +31,7 @@ (define-module (gnu services shepherd)
   #:use-module ((guix diagnostics)
                 #:select (define-with-syntax-properties formatted-message))
   #:use-module (gnu services)
+  #:use-module (gnu services configuration)
   #:use-module (gnu services herd)
   #:use-module (gnu packages admin)
   #:use-module (ice-9 match)
@@ -84,6 +85,17 @@ (define-module (gnu services shepherd)
             shepherd-timer-service-type
             shepherd-transient-service-type
 
+            system-log-configuration
+            system-log-configuration?
+            system-log-configuration-provision
+            system-log-configuration-requirement
+            system-log-configuration-message-destination
+            system-log-configuration-date-format
+            system-log-configuration-history-size
+            system-log-configuration-max-silent-time
+
+            shepherd-system-log-service-type
+
             assert-valid-graph))
 
 ;;; Commentary:
@@ -721,3 +733,99 @@ (define shepherd-transient-service-type
 
 This runs @command{rsync} in the background, as a service that you can inspect
 with @command{herd status} and stop with @command{herd stop}.")))
+
+
+;;;
+;;; System log.
+;;;
+
+(define (gexp-or-false? x)
+  (or (gexp? x) (not x)))
+
+(define (gexp-or-integer? x)
+  (or (gexp? x) (integer? x)))
+
+(define (gexp-or-string? x)
+  (or (gexp? x) (string? x)))
+
+(define (gexp-or-string-or-false? x)
+  (or (gexp-or-string? x) (not x)))
+
+(define-configuration system-log-configuration
+  (provision
+   (list-of-symbols '(system-log syslogd))
+   "The name(s) of the system log service."
+   empty-serializer)
+  (requirement
+   (list-of-symbols '(root-file-system))
+   "Dependencies of the system log service."
+   empty-serializer)
+  (kernel-log-file
+   (gexp-or-string-or-false #~(kernel-log-file))
+   "File from which kernel messages are read, @file{/dev/kmsg} by default."
+   empty-serializer)
+  (message-destination
+   (gexp-or-false #f)
+   "This gexp must evaluate to a procedure that, when passed a log message,
+returns the list of files to write it to; @code{#f} is equivalent to using
+@code{(default-message-destination-procedure)}.  @pxref{System Log Service,,,
+shepherd, The GNU Shepherd Manual}, for information on how to write that
+procedure."
+   empty-serializer)
+  (date-format
+   (gexp-or-string #~default-logfile-date-format)
+   "String or string-valued gexp providing a specifying how to format
+timestamps in log file.  It must be a valid string for @code{strftime},
+including delimiting space---e.g., @code{\"%c \"} for a format identical to
+that of traditional syslogd implementations."
+   empty-serializer)
+  (history-size
+   (gexp-or-integer #~(default-log-history-size))
+   "Number of logging messages kept in memory for the purposes of making them
+available to @command{herd status system-log}."
+   empty-serializer)
+  (max-silent-time
+   (gexp-or-integer #~(default-max-silent-time))
+   "Time after which a mark is written to log files if nothing was logged
+during that time frame."
+   empty-serializer))
+
+(define shepherd-system-log-service-type
+  (shepherd-service-type
+   'shepherd-system-log
+   (lambda (config)
+     (shepherd-service
+      (documentation "Shepherd's built-in system log (syslogd).")
+      (provision (system-log-configuration-provision config))
+      (requirement (system-log-configuration-requirement config))
+      (modules '((shepherd service system-log)
+                 ((shepherd support) #:select (default-logfile-date-format))
+                 ((shepherd logger) #:select (default-log-history-size))))
+      (free-form
+       #~(system-log-service #:provision
+                             '#$(system-log-configuration-provision config)
+                             #:requirement
+                             '#$(system-log-configuration-requirement config)
+
+                             ;; XXX: As of Shepherd 1.0.1,
+                             ;; 'default-message-destination-procedure' is not
+                             ;; exported, hence this conditional.
+                             #$@(match (system-log-configuration-message-destination
+                                        config)
+                                  (#f #~())
+                                  (value #~(#:message-destination #$value)))
+
+                             #:date-format
+                             #$(system-log-configuration-date-format
+                                config)
+                             #:history-size
+                             #$(system-log-configuration-history-size config)
+                             #:max-silent-time
+                             #$(system-log-configuration-max-silent-time
+                                config)))))
+   (system-log-configuration)
+   (description
+    "The Shepherd's @code{system-log} service plays the role of traditional
+@command{syslogd} daemons, reading data logged by daemons to @file{/dev/log}
+and writing it to several files in @file{/var/log} according to user-provided
+dispatching rules.")))
-- 
2.48.1





Information forwarded to ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Tue, 04 Feb 2025 22:59:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76063 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 2/3] services: Switch to ‘shepherd-system-log-service-type’ in ‘%base-services’.
Date: Tue,  4 Feb 2025 23:57:48 +0100
* gnu/services/base.scm (%base-services): Replace ‘syslog-service-type’
by ‘shepherd-system-log-service-type’.
* doc/guix.texi (Base Services): Update ‘syslog-service-type’
documentation.
(Shepherd Services): Mention that ‘system-log-service-type’ is in
‘%base-services’.  Add anchor.

Change-Id: I21082300f6a052865a6ab1bdff27fbe71f73d492
---
 doc/guix.texi         | 17 +++++++++++++----
 gnu/services/base.scm |  2 +-
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index f52d79d549..fa51630852 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19867,11 +19867,17 @@ Base Services
 external name servers do not even need to be queried.
 @end defvar
 
-@cindex syslog
-@cindex logging
+@cindex syslog, with external syslogd
+@cindex logging, syslog
 @defvar syslog-service-type
-Type of the service that runs the syslog daemon, whose value is a
-@code{<syslog-configuration>} object.
+Type of the service that runs the syslog daemon (@command{syslogd}),
+whose value is a @code{<syslog-configuration>} object (see below).
+
+@quotation Note
+This service is redundant with and for the most part superseded by
+@code{shepherd-system-log-service-type} (@pxref{shepherd-system-log, the
+Shepherd system log}).
+@end quotation
 @end defvar
 
 To have a modified @code{syslog-configuration} come into effect after
@@ -45757,6 +45763,7 @@ Shepherd Services
 on the @code{timer} service.
 @end defvar
 
+@anchor{shepherd-system-log}
 @cindex system log service, from Shepherd
 @cindex syslogd, Shepherd system log service
 @defvar shepherd-system-log-service-type
@@ -45767,6 +45774,8 @@ Shepherd Services
 
 The value of services of this type must be a
 @code{system-log-configuration} record, as described below.
+
+This service is part of @code{%base-services} (@pxref{Base Services}).
 @end defvar
 
 @c %start of fragment
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 7331c030d7..9bd76d3550 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -3722,7 +3722,7 @@ (define %base-services
                         (cons tty %default-console-font))
                       '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
 
-        (service syslog-service-type)
+        (service shepherd-system-log-service-type)
         (service agetty-service-type (agetty-configuration
                                        (extra-options '("-L")) ; no carrier detect
                                        (term "vt100")
-- 
2.48.1





Information forwarded to pelzflorian <at> pelzflorian.de, julien <at> lepiller.eu, guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Tue, 04 Feb 2025 22:59:03 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76063 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 3/3] DRAFT: news: Add entry for ‘system-log’ switch.
Date: Tue,  4 Feb 2025 23:57:49 +0100
DRAFT: Update commit ID.

* etc/news.scm: Add entry.

Change-Id: Ie3d827741a01c95f2bea908b57c707342e8f2386
---
 etc/news.scm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/etc/news.scm b/etc/news.scm
index dfc64d59cd..5e1b3a8bff 100644
--- a/etc/news.scm
+++ b/etc/news.scm
@@ -35,7 +35,21 @@
 (channel-news
  (version 0)
 
-  (entry (commit "616ae36e0f557cecb4abe58c5b0973b9428d25e0")
+ (entry (commit "TODO")
+        (title
+         (en "Guix System switches to the Shepherd's system log"))
+        (body
+         (en "The default system log used on Guix System and part of
+@code{%base-services} has been switched from the @command{syslogd} command of
+GNU <at> tie{}Inetutils to the new built-in @code{system-log} service found in
+version 1.0 of the Shepherd.
+
+The advantages of this change are the fact that @code{system-log} can start
+logging earlier after boot and stop shortly before shutdown, along with full
+integration with the rest of @command{shepherd}, in particular with the new
+@command{log-rotation} service.")))
+
+ (entry (commit "616ae36e0f557cecb4abe58c5b0973b9428d25e0")
         (title
          (en "Kernel persistent storage in UEFI disabled"))
         (body
-- 
2.48.1





Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Thu, 06 Feb 2025 11:59:02 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 76063 <at> debbugs.gnu.org
Subject: Re: [bug#76063] [PATCH 3/3] DRAFT: news: Add entry for
 ‘system-log’ switch.
Date: Thu, 06 Feb 2025 12:58:40 +0100
[Message part 1 (text/plain, inline)]
Nice; could you add this German translation?

[german-news-for-system-log.diff (text/x-patch, inline)]
diff --git a/etc/news.scm b/etc/news.scm
index 5e1b3a8bff..fb46e2c24d 100644
--- a/etc/news.scm
+++ b/etc/news.scm
@@ -37,7 +37,8 @@
 
  (entry (commit "TODO")
         (title
-         (en "Guix System switches to the Shepherd's system log"))
+         (en "Guix System switches to the Shepherd's system log")
+         (de "Guix System wechselt zu Shepherds Systemprotokoll"))
         (body
          (en "The default system log used on Guix System and part of
 @code{%base-services} has been switched from the @command{syslogd} command of
@@ -47,7 +48,17 @@
 The advantages of this change are the fact that @code{system-log} can start
 logging earlier after boot and stop shortly before shutdown, along with full
 integration with the rest of @command{shepherd}, in particular with the new
-@command{log-rotation} service.")))
+@command{log-rotation} service.")
+         (de "Das vorgegebene Systemprotokoll, das auf Guix System benutzt
+wird und Teil von @code{%base-services} ist, wurde ausgetauscht und anstelle
+des Befehls @command{syslogd} aus den GNU <at> tie{}Inetutils wird der neue, in
+Version 1.0 von Shepherd eingebaute @code{system-log}-Dienst benutzt.
+
+Die Vorteile dieser Änderung sind, dass @code{system-log} schon früher nach
+dem Start Protokolle aufnehmen kann, kurz vor dem Herunterfahren damit aufhört
+und außerdem mit dem Rest von @command{shepherd} voll integriert ist,
+insbesondere mit dem neuen Dienst @command{log-rotation} zur
+Protokollrotation.")))
 
  (entry (commit "616ae36e0f557cecb4abe58c5b0973b9428d25e0")
         (title
-- 
2.48.1

[Message part 3 (text/plain, inline)]
Regards,
Florian

Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Thu, 06 Feb 2025 14:28:05 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 76063 <at> debbugs.gnu.org
Subject: Re: [bug#76063] [PATCH 1/3] services: Add ‘system-log’ Shepherd service.
Date: Thu, 06 Feb 2025 23:26:40 +0900
Hello!

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

> * gnu/services/shepherd.scm (gexp-or-integer?)
> (gexp-or-string?, gexp-or-string-or-false?): New procedures.
> (system-log-configuration): New record type.

It's not as apparent due to coming into existence via a syntax, but
there many new symbols not listed here (such as each public field
accessor).

> (shepherd-system-log-service-type): New variable.
> * doc/guix.texi (Shepherd Services): Document it.
>
> Change-Id: I1e29fe0977eb4f8026ee6a2d2f282e269c8c00b4
> ---
>  doc/guix.texi             |  55 +++++++++++++++++++
>  gnu/services/shepherd.scm | 108 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 163 insertions(+)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index bb5f29277f..f52d79d549 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -45757,6 +45757,61 @@ Shepherd Services
>  on the @code{timer} service.
>  @end defvar
>  
> +@cindex system log service, from Shepherd
> +@cindex syslogd, Shepherd system log service
> +@defvar shepherd-system-log-service-type
> +This service implements a @dfn{system log}, reading messages
> +applications send to @file{/dev/log} and writing them to files or
> +terminals according to user-defined rules.  It provides functionality
> +traditionally implemented by @command{syslogd} programs.
> +
> +The value of services of this type must be a
> +@code{system-log-configuration} record, as described below.
> +@end defvar
> +
> +@c %start of fragment

Neat that you finally embraced define-configuration :-).

Side-topic: one day (TM), I'd like to work on a system that'd generate
and splice/update these fragments automatically in our doc, avoiding the
laborious copy-pasting.  

[...]

> diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
> index 328bfbedff..bc31285cfb 100644
> --- a/gnu/services/shepherd.scm
> +++ b/gnu/services/shepherd.scm
> @@ -31,6 +31,7 @@ (define-module (gnu services shepherd)
>    #:use-module ((guix diagnostics)
>                  #:select (define-with-syntax-properties formatted-message))
>    #:use-module (gnu services)
> +  #:use-module (gnu services configuration)
>    #:use-module (gnu services herd)
>    #:use-module (gnu packages admin)
>    #:use-module (ice-9 match)
> @@ -84,6 +85,17 @@ (define-module (gnu services shepherd)
>              shepherd-timer-service-type
>              shepherd-transient-service-type
>  
> +            system-log-configuration
> +            system-log-configuration?
> +            system-log-configuration-provision
> +            system-log-configuration-requirement
> +            system-log-configuration-message-destination
> +            system-log-configuration-date-format
> +            system-log-configuration-history-size
> +            system-log-configuration-max-silent-time
> +
> +            shepherd-system-log-service-type
> +
>              assert-valid-graph))
>  
>  ;;; Commentary:
> @@ -721,3 +733,99 @@ (define shepherd-transient-service-type
>  
>  This runs @command{rsync} in the background, as a service that you can inspect
>  with @command{herd status} and stop with @command{herd stop}.")))
> +
> +
> +;;;
> +;;; System log.
> +;;;
> +
> +(define (gexp-or-false? x)
> +  (or (gexp? x) (not x)))
> +
> +(define (gexp-or-integer? x)
> +  (or (gexp? x) (integer? x)))
> +
> +(define (gexp-or-string? x)
> +  (or (gexp? x) (string? x)))
> +
> +(define (gexp-or-string-or-false? x)
> +  (or (gexp-or-string? x) (not x)))
> +
> +(define-configuration system-log-configuration
> +  (provision
> +   (list-of-symbols '(system-log syslogd))
> +   "The name(s) of the system log service."
> +   empty-serializer)
> +  (requirement
> +   (list-of-symbols '(root-file-system))
> +   "Dependencies of the system log service."
> +   empty-serializer)
> +  (kernel-log-file
> +   (gexp-or-string-or-false #~(kernel-log-file))
> +   "File from which kernel messages are read, @file{/dev/kmsg} by default."
> +   empty-serializer)
> +  (message-destination
> +   (gexp-or-false #f)
> +   "This gexp must evaluate to a procedure that, when passed a log message,
> +returns the list of files to write it to; @code{#f} is equivalent to using
> +@code{(default-message-destination-procedure)}.  @pxref{System Log Service,,,
> +shepherd, The GNU Shepherd Manual}, for information on how to write that
> +procedure."

I think you should use just @xref here, since it's at the beginning of a
sentence and not within parentheses.

> +   empty-serializer)
> +  (date-format
> +   (gexp-or-string #~default-logfile-date-format)
> +   "String or string-valued gexp providing a specifying how to format

s/providing a //

> +timestamps in log file.  It must be a valid string for @code{strftime},
> +including delimiting space---e.g., @code{\"%c \"} for a format identical to
> +that of traditional syslogd implementations."

Perhaps add a reference to @samp{man 3 strftime}.

> +   empty-serializer)
> +  (history-size
> +   (gexp-or-integer #~(default-log-history-size))
> +   "Number of logging messages kept in memory for the purposes of making them
> +available to @command{herd status system-log}."
> +   empty-serializer)
> +  (max-silent-time
> +   (gexp-or-integer #~(default-max-silent-time))
> +   "Time after which a mark is written to log files if nothing was logged
> +during that time frame."
> +   empty-serializer))

It seems the whole above configuration is not to be serialized, so you
should use define-configuration/no-serialization, which would save some
boring repetition of 'empty-serializer'.

> +
> +(define shepherd-system-log-service-type
> +  (shepherd-service-type
> +   'shepherd-system-log
> +   (lambda (config)

I'd bind the record values here using 'match-record', which would make
the part below more concise.

> +     (shepherd-service
> +      (documentation "Shepherd's built-in system log (syslogd).")
> +      (provision (system-log-configuration-provision config))
> +      (requirement (system-log-configuration-requirement config))
> +      (modules '((shepherd service system-log)
> +                 ((shepherd support) #:select (default-logfile-date-format))
> +                 ((shepherd logger) #:select (default-log-history-size))))
> +      (free-form
> +       #~(system-log-service #:provision
> +                             '#$(system-log-configuration-provision config)
> +                             #:requirement
> +                             '#$(system-log-configuration-requirement config)
> +
> +                             ;; XXX: As of Shepherd 1.0.1,
> +                             ;; 'default-message-destination-procedure' is not
> +                             ;; exported, hence this conditional.

Perhaps check if we have shepherd >= 1.0.2 (?) and put the
forward-looking code in this case, with the other code path ready to be
removed after some time, if it's easy to check for the shepherd version.

> +                             #$@(match (system-log-configuration-message-destination
> +                                        config)
> +                                  (#f #~())
> +                                  (value #~(#:message-destination #$value)))
> +
> +                             #:date-format
> +                             #$(system-log-configuration-date-format
> +                                config)

Not really relevant here, but that makes me recall that Guile currently
lacks monotonic time support (time that can't move backward the
adjusting the system clock).  It could make funny log time stamps.

See in srfi-19.scm:

--8<---------------cut here---------------start------------->8---
;; -- we define it to be the same as TAI.
;;    A different implementation of current-time-monotonic
;;    will require rewriting all of the time-monotonic converters,
;;    of course.

(define (current-time-monotonic)
  ;; Guile monotonic and TAI times are the same.
  (let ((tai (current-time-tai)))
    (make-time time-monotonic
               (time-nanosecond tai)
               (time-second tai))))
--8<---------------cut here---------------end--------------->8---

which as far as I can see uses CLOCK_REALTIME and not CLOCK_MONOTONIC as
it relies on gettimeofday(2), which has this note in its documentation:

--8<---------------cut here---------------start------------->8---
       The time returned by gettimeofday() is affected by discontinuous  jumps
       in  the system time (e.g., if the system administrator manually changes
       the system time).  If you need a monotonically  increasing  clock,  see
       clock_gettime(2).
--8<---------------cut here---------------end--------------->8---

Perhaps we should open an issue in Guile to remember to tacle this
deficiency?


> +                             #:history-size
> +                             #$(system-log-configuration-history-size config)
> +                             #:max-silent-time
> +                             #$(system-log-configuration-max-silent-time
> +                                config)))))
> +   (system-log-configuration)
> +   (description
> +    "The Shepherd's @code{system-log} service plays the role of traditional
> +@command{syslogd} daemons, reading data logged by daemons to @file{/dev/log}

Perhaps s/daemons/services/ for the second one, to avoid repetition and
clarify these are not the same daemons.

> +and writing it to several files in @file{/var/log} according to user-provided
> +dispatching rules.")))

Perhaps, 'several files under the @file{/var/log} directory, [...]'

Other than these small things, it LGTM.

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

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Thu, 06 Feb 2025 14:29:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 76063 <at> debbugs.gnu.org
Subject: Re: [bug#76063] [PATCH 2/3] services: Switch to
 ‘shepherd-system-log-service-type’ in
 ‘%base-services’.
Date: Thu, 06 Feb 2025 23:27:46 +0900
Ludovic Courtès <ludo <at> gnu.org> writes:

> * gnu/services/base.scm (%base-services): Replace ‘syslog-service-type’
> by ‘shepherd-system-log-service-type’.
> * doc/guix.texi (Base Services): Update ‘syslog-service-type’
> documentation.
> (Shepherd Services): Mention that ‘system-log-service-type’ is in
> ‘%base-services’.  Add anchor.
>
> Change-Id: I21082300f6a052865a6ab1bdff27fbe71f73d492

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

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Thu, 06 Feb 2025 14:30:04 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 76063 <at> debbugs.gnu.org,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#76063] [PATCH 3/3] DRAFT: news: Add entry for
 ‘system-log’ switch.
Date: Thu, 06 Feb 2025 23:28:44 +0900
Ludovic Courtès <ludo <at> gnu.org> writes:

> DRAFT: Update commit ID.
>
> * etc/news.scm: Add entry.
>
> Change-Id: Ie3d827741a01c95f2bea908b57c707342e8f2386

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

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Sun, 09 Feb 2025 11:06:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 76063 <at> debbugs.gnu.org
Subject: Re: [bug#76063] [PATCH 1/3] services: Add ‘system-log’ Shepherd service.
Date: Sun, 09 Feb 2025 12:05:20 +0100
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:

> Not really relevant here, but that makes me recall that Guile currently
> lacks monotonic time support (time that can't move backward the
> adjusting the system clock).  It could make funny log time stamps.
>
> See in srfi-19.scm:
>
> ;; -- we define it to be the same as TAI.
> ;;    A different implementation of current-time-monotonic
> ;;    will require rewriting all of the time-monotonic converters,
> ;;    of course.
>
> (define (current-time-monotonic)
>   ;; Guile monotonic and TAI times are the same.
>   (let ((tai (current-time-tai)))
>     (make-time time-monotonic
>                (time-nanosecond tai)
>                (time-second tai))))
>
>
> which as far as I can see uses CLOCK_REALTIME and not CLOCK_MONOTONIC as
> it relies on gettimeofday(2), which has this note in its documentation:
>
>        The time returned by gettimeofday() is affected by discontinuous  jumps
>        in  the system time (e.g., if the system administrator manually changes
>        the system time).  If you need a monotonically  increasing  clock,  see
>        clock_gettime(2).
>
> Perhaps we should open an issue in Guile to remember to tacle this
> deficiency?

Yes indeed, that’s a problem!

(Monotonic time support is available by other means like
‘get-internal-run-time’ but it would be good to fix SRFI-19.)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Wed, 12 Feb 2025 16:09:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 76063 <at> debbugs.gnu.org
Subject: Re: [bug#76063] [PATCH 1/3] services: Add ‘system-log’ Shepherd service.
Date: Thu, 13 Feb 2025 01:08:09 +0900
Hi,

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

> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:
>
>> Not really relevant here, but that makes me recall that Guile currently
>> lacks monotonic time support (time that can't move backward the
>> adjusting the system clock).  It could make funny log time stamps.

[...]

>> Perhaps we should open an issue in Guile to remember to tacle this
>> deficiency?
>
> Yes indeed, that’s a problem!
>
> (Monotonic time support is available by other means like
> ‘get-internal-run-time’ but it would be good to fix SRFI-19.)

For the record, reported in bug#76227.

-- 
Thanks,
Maxim




Information forwarded to ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Thu, 13 Feb 2025 23:11:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76063 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 1/3] services: Add ‘system-log’ Shepherd service.
Date: Fri, 14 Feb 2025 00:10:10 +0100
* gnu/services/shepherd.scm (gexp-or-integer?)
(gexp-or-string?, gexp-or-string-or-false?): New procedures.
(system-log-configuration): New record type.
(shepherd-system-log-service-type): New variable.
* doc/guix.texi (Shepherd Services): Document it.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Change-Id: I1e29fe0977eb4f8026ee6a2d2f282e269c8c00b4
---
 doc/guix.texi             | 56 +++++++++++++++++++++++
 gnu/services/shepherd.scm | 96 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 152 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 278e610194b..0824bc5b0b7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -45981,6 +45981,62 @@ Shepherd Services
 on the @code{timer} service.
 @end defvar
 
+@cindex system log service, from Shepherd
+@cindex syslogd, Shepherd system log service
+@defvar shepherd-system-log-service-type
+This service implements a @dfn{system log}, reading messages
+applications send to @file{/dev/log} and writing them to files or
+terminals according to user-defined rules.  It provides functionality
+traditionally implemented by @command{syslogd} programs.
+
+The value of services of this type must be a
+@code{system-log-configuration} record, as described below.
+@end defvar
+
+@c %start of fragment
+
+@deftp {Data Type} system-log-configuration
+Available @code{system-log-configuration} fields are:
+
+@table @asis
+@item @code{provision} (default: @code{(system-log syslogd)}) (type: list-of-symbols)
+The name(s) of the system log service.
+
+@item @code{requirement} (default: @code{(root-file-system)}) (type: list-of-symbols)
+Dependencies of the system log service.
+
+@item @code{kernel-log-file} (type: gexp-or-string-or-false)
+File from which kernel messages are read, @file{/dev/kmsg} by default.
+
+@item @code{message-destination} (default: @code{#f}) (type: gexp-or-false)
+This gexp must evaluate to a procedure that, when passed a log message,
+returns the list of files to write it to; @code{#f} is equivalent to
+using @code{(default-message-destination-procedure)}.  @xref{System Log
+Service,,,shepherd,The GNU Shepherd Manual}, for information on how to
+write that procedure.
+
+@item @code{date-format} (type: gexp-or-string)
+String or string-valued gexp specifying how to format timestamps in log
+file.  It must be a valid string for @code{strftime} (@pxref{Time,,,
+guile,GNU Guile Reference Manual}), including delimiting space---e.g.,
+@code{"%c "} for a format identical to that of traditional syslogd
+implementations.
+
+@item @code{history-size} (type: gexp-or-integer)
+Number of logging messages kept in memory for the purposes of making
+them available to @command{herd status system-log}.
+
+@item @code{max-silent-time} (type: gexp-or-integer)
+Time after which a mark is written to log files if nothing was logged
+during that time frame.
+
+@end table
+
+@end deftp
+
+
+@c %end of fragment
+
 @defvar %shepherd-root-service
 This service represents PID <at> tie{}1.
 @end defvar
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 52588c04e31..cfbb3f1e30a 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -31,6 +31,7 @@ (define-module (gnu services shepherd)
   #:use-module ((guix diagnostics)
                 #:select (define-with-syntax-properties formatted-message))
   #:use-module (gnu services)
+  #:use-module (gnu services configuration)
   #:use-module (gnu services herd)
   #:use-module (gnu packages admin)
   #:use-module (ice-9 match)
@@ -84,6 +85,17 @@ (define-module (gnu services shepherd)
             shepherd-timer-service-type
             shepherd-transient-service-type
 
+            system-log-configuration
+            system-log-configuration?
+            system-log-configuration-provision
+            system-log-configuration-requirement
+            system-log-configuration-message-destination
+            system-log-configuration-date-format
+            system-log-configuration-history-size
+            system-log-configuration-max-silent-time
+
+            shepherd-system-log-service-type
+
             assert-valid-graph))
 
 ;;; Commentary:
@@ -658,3 +670,87 @@ (define shepherd-transient-service-type
 
 This runs @command{rsync} in the background, as a service that you can inspect
 with @command{herd status} and stop with @command{herd stop}.")))
+
+
+;;;
+;;; System log.
+;;;
+
+(define (gexp-or-false? x)
+  (or (gexp? x) (not x)))
+
+(define (gexp-or-integer? x)
+  (or (gexp? x) (integer? x)))
+
+(define (gexp-or-string? x)
+  (or (gexp? x) (string? x)))
+
+(define (gexp-or-string-or-false? x)
+  (or (gexp-or-string? x) (not x)))
+
+(define-configuration/no-serialization system-log-configuration
+  (provision
+   (list-of-symbols '(system-log syslogd))
+   "The name(s) of the system log service.")
+  (requirement
+   (list-of-symbols '(root-file-system))
+   "Dependencies of the system log service.")
+  (kernel-log-file
+   (gexp-or-string-or-false #~(kernel-log-file))
+   "File from which kernel messages are read, @file{/dev/kmsg} by default.")
+  (message-destination
+   (gexp-or-false #f)
+   "This gexp must evaluate to a procedure that, when passed a log message,
+returns the list of files to write it to; @code{#f} is equivalent to using
+@code{(default-message-destination-procedure)}.  @xref{System Log Service,,,
+shepherd, The GNU Shepherd Manual}, for information on how to write that
+procedure.")
+  (date-format
+   (gexp-or-string #~default-logfile-date-format)
+   "String or string-valued gexp specifying how to format timestamps in log
+file.  It must be a valid string for @code{strftime} (@pxref{Time,,, guile,
+GNU Guile Reference Manual}), including delimiting space---e.g., @code{\"%c
+\"} for a format identical to that of traditional syslogd implementations.")
+  (history-size
+   (gexp-or-integer #~(default-log-history-size))
+   "Number of logging messages kept in memory for the purposes of making them
+available to @command{herd status system-log}.")
+  (max-silent-time
+   (gexp-or-integer #~(default-max-silent-time))
+   "Time after which a mark is written to log files if nothing was logged
+during that time frame."))
+
+(define shepherd-system-log-service-type
+  (shepherd-service-type
+   'shepherd-system-log
+   (lambda (config)
+     (match-record config <system-log-configuration>
+       (provision requirement message-destination
+        date-format history-size max-silent-time)
+       (shepherd-service
+        (documentation "Shepherd's built-in system log (syslogd).")
+        (provision (system-log-configuration-provision config))
+        (requirement (system-log-configuration-requirement config))
+        (modules '((shepherd service system-log)
+                   ((shepherd support) #:select (default-logfile-date-format))
+                   ((shepherd logger) #:select (default-log-history-size))))
+        (free-form
+         #~(system-log-service #:provision '#$provision
+                               #:requirement '#$requirement
+
+                               ;; XXX: As of Shepherd 1.0.1,
+                               ;; 'default-message-destination-procedure' is not
+                               ;; exported, hence this conditional.
+                               #$@(match message-destination
+                                    (#f #~())
+                                    (value #~(#:message-destination #$value)))
+
+                               #:date-format #$date-format
+                               #:history-size #$history-size
+                               #:max-silent-time #$max-silent-time)))))
+   (system-log-configuration)
+   (description
+    "The Shepherd's @code{system-log} service plays the role of traditional
+@command{syslogd} program, reading data logged by daemons to @file{/dev/log}
+and writing it to several files in @file{/var/log} according to user-provided
+dispatching rules.")))

base-commit: 2afb48804e4ff829ed5ed97757fde0a2cd8e39fc
-- 
2.48.1





Information forwarded to ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Thu, 13 Feb 2025 23:11:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76063 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 2/3] services: Switch to ‘shepherd-system-log-service-type’ in ‘%base-services’.
Date: Fri, 14 Feb 2025 00:10:11 +0100
* gnu/services/base.scm (%base-services): Replace ‘syslog-service-type’
by ‘shepherd-system-log-service-type’.
* doc/guix.texi (Base Services): Update ‘syslog-service-type’
documentation.
(Shepherd Services): Mention that ‘system-log-service-type’ is in
‘%base-services’.  Add anchor.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Change-Id: I21082300f6a052865a6ab1bdff27fbe71f73d492
---
 doc/guix.texi         | 17 +++++++++++++----
 gnu/services/base.scm |  2 +-
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 0824bc5b0b7..54c365abf3b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19880,11 +19880,17 @@ Base Services
 external name servers do not even need to be queried.
 @end defvar
 
-@cindex syslog
-@cindex logging
+@cindex syslog, with external syslogd
+@cindex logging, syslog
 @defvar syslog-service-type
-Type of the service that runs the syslog daemon, whose value is a
-@code{<syslog-configuration>} object.
+Type of the service that runs the syslog daemon (@command{syslogd}),
+whose value is a @code{<syslog-configuration>} object (see below).
+
+@quotation Note
+This service is redundant with and for the most part superseded by
+@code{shepherd-system-log-service-type} (@pxref{shepherd-system-log, the
+Shepherd system log}).
+@end quotation
 @end defvar
 
 To have a modified @code{syslog-configuration} come into effect after
@@ -45981,6 +45987,7 @@ Shepherd Services
 on the @code{timer} service.
 @end defvar
 
+@anchor{shepherd-system-log}
 @cindex system log service, from Shepherd
 @cindex syslogd, Shepherd system log service
 @defvar shepherd-system-log-service-type
@@ -45991,6 +45998,8 @@ Shepherd Services
 
 The value of services of this type must be a
 @code{system-log-configuration} record, as described below.
+
+This service is part of @code{%base-services} (@pxref{Base Services}).
 @end defvar
 
 @c %start of fragment
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 4bc0433def6..684de754e6d 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -3931,7 +3931,7 @@ (define %base-services
                         (cons tty %default-console-font))
                       '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
 
-        (service syslog-service-type)
+        (service shepherd-system-log-service-type)
         (service agetty-service-type (agetty-configuration
                                        (extra-options '("-L")) ; no carrier detect
                                        (term "vt100")
-- 
2.48.1





Information forwarded to pelzflorian <at> pelzflorian.de, julien <at> lepiller.eu, guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Thu, 13 Feb 2025 23:11:03 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76063 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 3/3] DRAFT: news: Add entry for ‘system-log’ switch.
Date: Fri, 14 Feb 2025 00:10:12 +0100
DRAFT: Update commit ID.

* etc/news.scm: Add entry.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Co-authored-by: Florian Pelz <pelzflorian <at> pelzflorian.de>
Change-Id: Ie3d827741a01c95f2bea908b57c707342e8f2386
---
 etc/news.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/etc/news.scm b/etc/news.scm
index 106a58a2b0a..8c9e1634890 100644
--- a/etc/news.scm
+++ b/etc/news.scm
@@ -37,6 +37,43 @@
 (channel-news
  (version 0)
 
+ (entry (commit "TODO")
+        (title
+         (en "Guix System switches to the Shepherd's system log")
+         (de "Guix System wechselt zu Shepherds Systemprotokoll")
+         (fr "Guix System passe au journal système de Shepherd")
+        (body
+         (en "The default system log used on Guix System and part of
+@code{%base-services} has been switched from the @command{syslogd} command of
+GNU <at> tie{}Inetutils to the new built-in @code{system-log} service found in
+version 1.0 of the Shepherd.
+
+The advantages of this change are the fact that @code{system-log} can start
+logging earlier after boot and stop shortly before shutdown, along with full
+integration with the rest of @command{shepherd}, in particular with the new
+@code{log-rotation} service.")
+         (de "Das vorgegebene Systemprotokoll, das auf Guix System benutzt
+wird und Teil von @code{%base-services} ist, wurde ausgetauscht und anstelle
+des Befehls @command{syslogd} aus den GNU <at> tie{}Inetutils wird der neue, in
+Version 1.0 von Shepherd eingebaute @code{system-log}-Dienst benutzt.
+
+Die Vorteile dieser Änderung sind, dass @code{system-log} schon früher nach
+dem Start Protokolle aufnehmen kann, kurz vor dem Herunterfahren damit aufhört
+und außerdem mit dem Rest von @command{shepherd} voll integriert ist,
+insbesondere mit dem neuen Dienst @code{log-rotation} zur
+Protokollrotation.")
+         (fr "Le journal système par défaut sur Guix System, qui fait partie
+de @code{%base-services}, est passé de la commande @command{syslogd} de
+GNU <at> tie{}Inetutils au nouveau service @code{system-log} fourni par la version
+1.0 du Shepherd.
+
+Les avantages de ce changement sont le fait que @code{system-log} peut
+commencer à enregistrer les journaux plus tôt pendant la séquence de
+démarrage et s'arrêter plus tard au moment de l'arrêt, ainsi que son
+intégration complète avec le reste de @command{shepherd}, en particulier avec
+le nouveau service @code{log-rotation}."))))
+
+
  (entry (commit "0753a17ddf6f4fab98b93c25f1a93b97ff9e46bb")
         (title
          (en "The @command{guix deploy} command now supports the Hetzner Cloud
-- 
2.48.1





Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Thu, 13 Feb 2025 23:15:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 76063 <at> debbugs.gnu.org
Subject: Re: [bug#76063] [PATCH 1/3] services: Add ‘system-log’ Shepherd service.
Date: Fri, 14 Feb 2025 00:14:33 +0100
Hi!

I’ve sent v2, which addresses all the points you raised, with one
exception:

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

>> +                             ;; XXX: As of Shepherd 1.0.1,
>> +                             ;; 'default-message-destination-procedure' is not
>> +                             ;; exported, hence this conditional.
>
> Perhaps check if we have shepherd >= 1.0.2 (?) and put the
> forward-looking code in this case, with the other code path ready to be
> removed after some time, if it's easy to check for the shepherd version.
>
>> +                             #$@(match (system-log-configuration-message-destination
>> +                                        config)
>> +                                  (#f #~())
>> +                                  (value #~(#:message-destination #$value)))

I kept it as is because we cannot really do what you describe: the
conditional would need to go in the default value of
‘message-destination’, like:

  #~(if (defined? 'default-message-destination-procedure)
        (default-message-destination-procedure)
        #f)

But if we did that it’d be hard to not pass #:message-destination in the
#f case.

(Not sure if I’m being clear, I hope you get the idea. :-))

Thanks for looking at it!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Sat, 15 Feb 2025 01:27:01 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 76063 <at> debbugs.gnu.org
Subject: Re: [PATCH v2 1/3] services: Add ‘system-log’ Shepherd service.
Date: Sat, 15 Feb 2025 10:25:42 +0900
Ludovic Courtès <ludo <at> gnu.org> writes:

> * gnu/services/shepherd.scm (gexp-or-integer?)
> (gexp-or-string?, gexp-or-string-or-false?): New procedures.
> (system-log-configuration): New record type.
> (shepherd-system-log-service-type): New variable.
> * doc/guix.texi (Shepherd Services): Document it.
>
> Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
> Change-Id: I1e29fe0977eb4f8026ee6a2d2f282e269c8c00b4

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

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Sat, 15 Feb 2025 01:27:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 76063 <at> debbugs.gnu.org
Subject: Re: [PATCH v2 2/3] services: Switch to
 ‘shepherd-system-log-service-type’ in
 ‘%base-services’.
Date: Sat, 15 Feb 2025 10:25:49 +0900
Ludovic Courtès <ludo <at> gnu.org> writes:

> * gnu/services/base.scm (%base-services): Replace ‘syslog-service-type’
> by ‘shepherd-system-log-service-type’.
> * doc/guix.texi (Base Services): Update ‘syslog-service-type’
> documentation.
> (Shepherd Services): Mention that ‘system-log-service-type’ is in
> ‘%base-services’.  Add anchor.
>
> Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
> Change-Id: I21082300f6a052865a6ab1bdff27fbe71f73d492

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

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Sat, 15 Feb 2025 01:27:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 76063 <at> debbugs.gnu.org, Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [PATCH v2 3/3] DRAFT: news: Add entry for ‘system-log’ switch.
Date: Sat, 15 Feb 2025 10:25:57 +0900
Ludovic Courtès <ludo <at> gnu.org> writes:

> DRAFT: Update commit ID.
>
> * etc/news.scm: Add entry.
>
> Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
> Co-authored-by: Florian Pelz <pelzflorian <at> pelzflorian.de>
> Change-Id: Ie3d827741a01c95f2bea908b57c707342e8f2386

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

-- 
Thanks,
Maxim




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sat, 15 Feb 2025 22:07:01 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Sat, 15 Feb 2025 22:07:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 76063-done <at> debbugs.gnu.org
Subject: Re: [bug#76063] [PATCH v2 1/3] services: Add ‘system-log’ Shepherd service.
Date: Sat, 15 Feb 2025 23:06:17 +0100
Pushed as 12bd93113c7a2ddf8c1db849550d1c0ae356f039, thank you!

Ludo’.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 17 Feb 2025 09:23:03 GMT) Full text and rfc822 format available.

Removed tag(s) patch. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 17 Feb 2025 09:23:03 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#76063; Package guix-patches. (Mon, 17 Feb 2025 09:27:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76063 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [bug#76063] [PATCH v2 2/3] services: Switch to
 ‘shepherd-system-log-service-type’ in
 ‘%base-services’.
Date: Mon, 17 Feb 2025 10:26:25 +0100
Hi,

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

> * gnu/services/base.scm (%base-services): Replace ‘syslog-service-type’
> by ‘shepherd-system-log-service-type’.
> * doc/guix.texi (Base Services): Update ‘syslog-service-type’
> documentation.
> (Shepherd Services): Mention that ‘system-log-service-type’ is in
> ‘%base-services’.  Add anchor.
>
> Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
> Change-Id: I21082300f6a052865a6ab1bdff27fbe71f73d492

I reverted this commit yesterday in
8c483c12e94bcf43e4c44170f1d5fea5fbba4970 due to deadlocks happening at
boot time and reported in <https://issues.guix.gnu.org/76315>.

I started investigating; it would seem to be a timing/scheduling issue
that shows up when eudev starts.  Adding a simple ‘format’ call in the
‘start’ method of eudev appears to “fix” the problem.

(Never encountered this on my laptop over 6+ months of ‘system-log’
usage…)

To be continued…

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Tue, 04 Mar 2025 23:37:01 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Tue, 04 Mar 2025 23:37:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76063-done <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [bug#76063] [PATCH v2 2/3] services: Switch to
 ‘shepherd-system-log-service-type’ in
 ‘%base-services’.
Date: Wed, 05 Mar 2025 00:36:21 +0100
Ludovic Courtès <ludo <at> gnu.org> skribis:

> Ludovic Courtès <ludo <at> gnu.org> skribis:
>
>> * gnu/services/base.scm (%base-services): Replace ‘syslog-service-type’
>> by ‘shepherd-system-log-service-type’.
>> * doc/guix.texi (Base Services): Update ‘syslog-service-type’
>> documentation.
>> (Shepherd Services): Mention that ‘system-log-service-type’ is in
>> ‘%base-services’.  Add anchor.
>>
>> Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
>> Change-Id: I21082300f6a052865a6ab1bdff27fbe71f73d492
>
> I reverted this commit yesterday in
> 8c483c12e94bcf43e4c44170f1d5fea5fbba4970 due to deadlocks happening at
> boot time and reported in <https://issues.guix.gnu.org/76315>.

Now that the issues that were reported have been fixed (they were
actually unrelated to system-log), I have reinstated it:

  f785ff154c0 news: Add entry for ‘system-log’ switch.
  8492a3c8962 services: Switch to ‘shepherd-system-log-service-type’ in ‘%base-services’.

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 02 Apr 2025 11:24:29 GMT) Full text and rfc822 format available.

This bug report was last modified 73 days ago.

Previous Next


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