[PATCH 0/2] Improve syslog service flexibility

  • Done
  • quality assurance status badge
Details
2 participants
  • Jean-Baptiste Note
  • Ludovic Courtès
Owner
unassigned
Submitted by
Jean-Baptiste Note
Severity
normal
J
J
Jean-Baptiste Note wrote on 30 Apr 17:34 +0200
(address . guix-patches@gnu.org)(name . Jean-Baptiste Note)(address . jean-baptiste.note@m4x.org)
cover.1714490986.git.jean-baptiste.note@m4x.org
While setting up centralized logging in a guix environment, I had to add flags
to the running syslog on the central server (udp networking, for instance).

Further, I had to use rsyslog instead of syslog.

The following set of patches enable both of these to be done. The patches are
independent conceptually but touch around the same pieces of code, so they're
presented as a set.

Jean-Baptiste Note (2):
services: syslog: Add extra-options argument to syslog service.
services: syslog: Adjust service for rsyslog compatibility.

doc/guix.texi | 3 +++
gnu/services/base.scm | 8 ++++++--
2 files changed, 9 insertions(+), 2 deletions(-)


--
2.41.0
J
J
Jean-Baptiste Note wrote on 30 Apr 17:36 +0200
[PATCH 1/2] services: syslog: Add extra-options argument to syslog service.
(address . 70677@debbugs.gnu.org)(name . Jean-Baptiste Note)(address . jean-baptiste.note@m4x.org)
44cb8b9fe93ffc2fb653657ea18374543d4f33db.1714490986.git.jean-baptiste.note@m4x.org
* 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
---
doc/guix.texi | 3 +++
gnu/services/base.scm | 7 +++++--
2 files changed, 8 insertions(+), 2 deletions(-)

Toggle diff (41 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 3a9afcd814..81e6283196 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19442,6 +19442,9 @@ Base Services
@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
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index f35d74ee40..47565a3d5a 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1553,7 +1553,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.
@@ -1589,7 +1591,8 @@ (define (syslog-shepherd-service config)
;; 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))))
--
2.41.0
J
J
Jean-Baptiste Note wrote on 30 Apr 17:36 +0200
[PATCH 2/2] services: syslog: Adjust service for rsyslog compatibility.
(address . 70677@debbugs.gnu.org)(name . Jean-Baptiste Note)(address . jean-baptiste.note@m4x.org)
36338d3a45a4f8644f209373d03b594015c6fd3b.1714490986.git.jean-baptiste.note@m4x.org
* gnu/services/base.scm (syslog-shepherd-service): Change flag for designating
configuration file. The long option is not compatible with rsyslog while the
short is; switch to the short one.
---
gnu/services/base.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 47565a3d5a..0d73e5344e 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1591,7 +1591,8 @@ (define (syslog-shepherd-service config)
;; action work as intended.
(start #~(make-forkexec-constructor
(list #$(syslog-configuration-syslogd config)
- #$(string-append "--rcfile=" syslog.conf)
+ ;; the -f option here is compatible with rsyslog
+ #$(string-append "-f " syslog.conf)
#$@(syslog-configuration-extra-options config))
#:file-creation-mask #o137
#:pid-file "/var/run/syslog.pid"))
--
2.41.0
L
L
Ludovic Courtès wrote 40 hours ago
Re: [bug#70677] [PATCH 0/2] Improve syslog service flexibility
(name . Jean-Baptiste Note)(address . jean-baptiste.note@m4x.org)(address . 70677-done@debbugs.gnu.org)
874j2u9vag.fsf@gnu.org
Hi,

Jean-Baptiste Note <jean-baptiste.note@m4x.org> skribis:

Toggle quote (13 lines)
> While setting up centralized logging in a guix environment, I had to add flags
> to the running syslog on the central server (udp networking, for instance).
>
> Further, I had to use rsyslog instead of syslog.
>
> The following set of patches enable both of these to be done. The patches are
> independent conceptually but touch around the same pieces of code, so they're
> presented as a set.
>
> Jean-Baptiste Note (2):
> services: syslog: Add extra-options argument to syslog service.
> services: syslog: Adjust service for rsyslog compatibility.

Finally applied.

Sorry that it took so many months for no good reason!

Ludo’.
Closed
J
J
Jean-Baptiste Note wrote 35 hours ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 70677-done@debbugs.gnu.org)
87jzbqxc3t.fsf@m4x.org
Hi Ludovic,

First, thank you for devoting some previous Christmas time to this. I'm
reading this out of office, and i'm suddenly assailed by a doubt. It's
been a while, but I think the second patch, amending the commandline,
was completely untested and completely wrong.

Indeed the string "-f syslog.conf" is not a proper argument and won't be
parsed as such, it should probably be something like "-f"
#$(syslog.conf) (two separate arguments).

I can't easily assess the situation from where I am, or access a
possibly updated patch version from work, but maybe the continuous
integration is showing the problem.

I'm very sorry for the situation, and I think you may want to revert
this part of the series to avoid nuisances to people who would do a
system upgrade.

I will send a fixed patch as soon as possible, which may take a few
days. The problem doesn't show upon system build but on system reboot,
and manifests itself with an early fail during the herd startup
sequence.

I'm very sorry about the situation, and even more so about wasting your
time.

Kind regards,
Jean-Baptiste
-----BEGIN PGP SIGNATURE-----

iQJPBAEBCAA5FiEEPxcq3dp4FVY5UpckkC0pVsuz75YFAmdp5XYbHGplYW4tYmFw
dGlzdGUubm90ZUBtNHgub3JnAAoJEJAtKVbLs++WLMMP/j+WJ1h1Y4MIqNazD1fs
ymu3P7igoswiacBTpYEvvEe+2Mi/t/AFOMxYRQ6G1vBhvVX/BXvFxUBL/NAgLMqY
fPI4KbUgQ+UcJWfR5WW+mo3CjXfg/L9MKRlUMcFX7o+Eofco4RTkRxGnNPGvVluv
Op20DMotz9vsieUYgHV7GH5LSb+N7PYX5SHHRTGq0EffkW3zLgbHBChVdIslZ3/d
2/NF3PW9cx+5ryG5dIe2M3cYX4ZmOVsghI86bLIFXN4eYWIuzbDZZpODNY2dd3PH
PkH5PD3tTgO7J+2ZkpDaiyxVWf5a1G5FNCoKQZo2jWeZ4IWsXiupjvMWdjjjkz5d
zDENKVVJplQspa88ZdHzg9+6xkEtuk5jpp5De/YUbcLpklTIGIQCrcgwJRULRFz3
C+QsYL0jkfSGZ4fJrBd38x24xWHtEcx5RHr0Ep8uetX2kYz4llCjaXdBtoBNS4Pz
bB4QqQFZ37RBTBjb3Nc4KeP6lhRdkM0L49Yhn8P5LAxi1tGSxBbII3F2OdJY8ZQq
NZnBEKw8W4gA/AX956nHcvkLDm7BRFOdS5qKSE8cVTkOfA56cPcptxFIy5UBUUpd
rtSmoejn4tSC2iAcUGuomNtdUfnY8paRQnwgKgdmQdEENM0AOUle6QbsXM+sRmRO
JOazrwQuv2Xjf8lI9dQmi8k/
=gGSj
-----END PGP SIGNATURE-----

Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 70677@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 70677
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch