~ruther/guix-local

c1e3c49135bb5fb94112fd48894b1ca7570785b3 — Ludovic Courtès 9 months ago df763d6
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
2 files changed, 11 insertions(+), 7 deletions(-)

M doc/guix.texi
M gnu/services/shepherd.scm
M doc/guix.texi => doc/guix.texi +5 -4
@@ 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


M gnu/services/shepherd.scm => gnu/services/shepherd.scm +6 -3
@@ 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