From c1e3c49135bb5fb94112fd48894b1ca7570785b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 18 Jul 2025 19:02:09 +0200 Subject: [PATCH] =?UTF-8?q?services:=20system-log:=20Allow=20=E2=80=98max-?= =?UTF-8?q?silent-time=E2=80=99=20to=20be=20#f.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/shepherd.scm (gexp-or-integer-or-false?): New procedure. (system-log-configuration)[max-silent-time]: Change to ‘gexp-or-integer-or-false’. * doc/guix.texi (Shepherd Services): Regenerate documentation with ‘configuration->documentation’. Change-Id: I75228cd19ca892c26347a64cbb952668fc893669 --- doc/guix.texi | 9 +++++---- gnu/services/shepherd.scm | 9 ++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index e2d546be0a0e10cb1f5253662b1add9e9babb2d6..037ed371d1f55f04378e0a91f554afa2e186601a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -48964,10 +48964,10 @@ This service is part of @code{%base-services} (@pxref{Base Services}). Available @code{system-log-configuration} fields are: @table @asis -@item @code{provision} (default: @code{'(system-log syslogd)}) (type: list-of-symbols) +@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) +@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) @@ -48991,9 +48991,10 @@ implementations. 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) +@item @code{max-silent-time} (type: gexp-or-integer-or-false) Time after which a mark is written to log files if nothing was logged -during that time frame. +during that time frame. When set to @code{#f}, this feature is +disabled. @end table diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index c8e01c9d832dd5bf1e8817bdf8ecfff157ff2426..1c5f66061536be6a2c956c7ce8aef13778326972 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -718,6 +718,9 @@ with @command{herd status} and stop with @command{herd stop}."))) (define (gexp-or-integer? x) (or (gexp? x) (integer? x))) +(define (gexp-or-integer-or-false? x) + (or (not x) (gexp-or-integer? x))) + (define (gexp-or-string? x) (or (gexp? x) (string? x))) @@ -744,7 +747,7 @@ 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, +files. 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 @@ -752,9 +755,9 @@ GNU Guile Reference Manual}), including delimiting space---e.g., @code{\"%c "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)) + (gexp-or-integer-or-false #~(default-max-silent-time)) "Time after which a mark is written to log files if nothing was logged -during that time frame.")) +during that time frame. When set to @code{#f}, this feature is disabled.")) (define shepherd-system-log-service-type (shepherd-service-type