services: system-log: Allow ‘max-silent-time’ to be #f.

* 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
This commit is contained in:
Ludovic Courtès 2025-07-18 19:02:09 +02:00
parent df763d6a2d
commit c1e3c49135
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 11 additions and 7 deletions

View file

@ -48964,10 +48964,10 @@ This service is part of @code{%base-services} (@pxref{Base Services}).
Available @code{system-log-configuration} fields are: Available @code{system-log-configuration} fields are:
@table @asis @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. 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. Dependencies of the system log service.
@item @code{kernel-log-file} (type: gexp-or-string-or-false) @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 Number of logging messages kept in memory for the purposes of making
them available to @command{herd status system-log}. 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 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 @end table

View file

@ -718,6 +718,9 @@ with @command{herd status} and stop with @command{herd stop}.")))
(define (gexp-or-integer? x) (define (gexp-or-integer? x)
(or (gexp? x) (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) (define (gexp-or-string? x)
(or (gexp? x) (string? x))) (or (gexp? x) (string? x)))
@ -744,7 +747,7 @@ procedure.")
(date-format (date-format
(gexp-or-string #~default-logfile-date-format) (gexp-or-string #~default-logfile-date-format)
"String or string-valued gexp specifying how to format timestamps in log "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 GNU Guile Reference Manual}), including delimiting space---e.g., @code{\"%c
\"} for a format identical to that of traditional syslogd implementations.") \"} for a format identical to that of traditional syslogd implementations.")
(history-size (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 "Number of logging messages kept in memory for the purposes of making them
available to @command{herd status system-log}.") available to @command{herd status system-log}.")
(max-silent-time (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 "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 (define shepherd-system-log-service-type
(shepherd-service-type (shepherd-service-type