services: syslog: Add extra-options argument to syslog service.

* gnu/services/base.scm (<syslog-configuration>): Add extra-options field.
  (syslog-shepherd-service): Use it when running the service.

* doc/guix.texi: Document it.

Change-Id: I540d070b9a9678b45ec9fa28d6fdc761f9b3fd9a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Jean-Baptiste Note 2024-04-30 15:36:21 +00:00 committed by Ludovic Courtès
parent ecb8ca6266
commit b732d702f9
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 8 additions and 2 deletions

View file

@ -19874,6 +19874,9 @@ The syslog configuration file to use.
@xref{syslogd invocation,,, inetutils, GNU Inetutils}, for more
information on the configuration file syntax.
@item @code{extra-options} (default: @code{'()})
List of extra command-line options for @command{syslog}.
@end table
@end deftp

View file

@ -1640,7 +1640,9 @@ (define-record-type* <syslog-configuration>
(syslogd syslog-configuration-syslogd
(default (file-append inetutils "/libexec/syslogd")))
(config-file syslog-configuration-config-file
(default %default-syslog.conf)))
(default %default-syslog.conf))
(extra-options syslog-configuration-extra-options
(default '())))
;;; Note: a static file name is used for syslog.conf so that the reload action
;;; work as intended.
@ -1676,7 +1678,8 @@ (define config-file
;; action work as intended.
(start #~(make-forkexec-constructor
(list #$(syslog-configuration-syslogd config)
#$(string-append "--rcfile=" syslog.conf))
#$(string-append "--rcfile=" syslog.conf)
#$@(syslog-configuration-extra-options config))
#:file-creation-mask #o137
#:pid-file "/var/run/syslog.pid"))
(stop #~(make-kill-destructor))))