GNU bug report logs - #70677
[PATCH 0/2] Improve syslog service flexibility

Previous Next

Package: guix-patches;

Reported by: Jean-Baptiste Note <jean-baptiste.note <at> m4x.org>

Date: Tue, 30 Apr 2024 15:36:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 70677 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#70677; Package guix-patches. (Tue, 30 Apr 2024 15:36:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jean-Baptiste Note <jean-baptiste.note <at> m4x.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 30 Apr 2024 15:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jean-Baptiste Note <jean-baptiste.note <at> m4x.org>
To: guix-patches <at> gnu.org
Cc: Jean-Baptiste Note <jean-baptiste.note <at> m4x.org>
Subject: [PATCH 0/2] Improve syslog service flexibility
Date: Tue, 30 Apr 2024 15:34:21 +0000
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





Information forwarded to guix-patches <at> gnu.org:
bug#70677; Package guix-patches. (Tue, 30 Apr 2024 15:38:01 GMT) Full text and rfc822 format available.

Message #8 received at 70677 <at> debbugs.gnu.org (full text, mbox):

From: Jean-Baptiste Note <jean-baptiste.note <at> m4x.org>
To: 70677 <at> debbugs.gnu.org
Cc: Jean-Baptiste Note <jean-baptiste.note <at> m4x.org>
Subject: [PATCH 1/2] services: syslog: Add extra-options argument to syslog
 service.
Date: Tue, 30 Apr 2024 15:36:21 +0000
* 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(-)

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





Information forwarded to guix-patches <at> gnu.org:
bug#70677; Package guix-patches. (Tue, 30 Apr 2024 15:38:02 GMT) Full text and rfc822 format available.

Message #11 received at 70677 <at> debbugs.gnu.org (full text, mbox):

From: Jean-Baptiste Note <jean-baptiste.note <at> m4x.org>
To: 70677 <at> debbugs.gnu.org
Cc: Jean-Baptiste Note <jean-baptiste.note <at> m4x.org>
Subject: [PATCH 2/2] services: syslog: Adjust service for rsyslog
 compatibility.
Date: Tue, 30 Apr 2024 15:36:22 +0000
* 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(-)

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





This bug report was last modified 16 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.