GNU bug report logs - #77943
[PATCH 0/2] Using the Shepherd's system log on the Hurd

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Sun, 20 Apr 2025 15:54:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 77943 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 janneke <at> gnu.org, guix-patches <at> gnu.org:
bug#77943; Package guix-patches. (Sun, 20 Apr 2025 15:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to janneke <at> gnu.org, guix-patches <at> gnu.org. (Sun, 20 Apr 2025 15:54:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Yelninei <yelninei <at> tutamail.com>
Subject: [PATCH 0/2] Using the Shepherd's system log on the Hurd
Date: Sun, 20 Apr 2025 17:52:37 +0200
Hello!

This changes the Hurd to use the Shepherd’s system log instead of
syslogd from Inetutils, as is already the case on Linux.  I wanted
to try now that Yelninei and I have addressed most of the issues
they reported in this area: <https://issues.guix.gnu.org/77634>.

It works, but maybe we should hold on a bit though, because of this:

--8<---------------cut here---------------start------------->8---
shepherd[1]: GNU Shepherd 1.0.4 (Guile 3.0.9, i586-pc-gnu)
shepherd[1]: Starting service root...
[…]
shepherd[1]: Service root-file-system running with value #t.
shepherd[1]: Service root-file-system has been started.
Uncaught exception in task:
In fibers.scm:
    172:8  7 (_)
In shepherd/service/system-log.scm:
    240:7  6 (run-system-log #<<channel> getq: #<atomic-box 33088d0?> ?)
In ice-9/suspendable-ports.scm:
   681:11  5 (read-delimited _ _ _)
    613:2  4 (read-char _)
   184:27  3 (fill-input #<input: /dev/klog 44> _ _)
     72:4  2 (read-bytes #<input: /dev/klog 44> #vu8(51 98 120 121 ?) ?)
In unknown file:
           1 (port-read #<input: /dev/klog 44> #vu8(51 98 120 121 ?) ?)
In ice-9/boot-9.scm:
  1685:16  0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure fport_read: (os/device) operation would block
--8<---------------cut here---------------end--------------->8---

It’s non-fatal but I think everything going to /dev/log after that
is dismissed—IOW, the system log doesn’t log anything.  There’s also
the "\0" sender that appears in /var/log/messages: it works, but it’s
not nice.

I reported it on bug-hurd and hopefully it has an easy solution.

Ludovic Courtès (2):
  services: shepherd: Provide the right #:kernel-log-file on the Hurd.
  system: hurd: Switch to the Shepherd’s system log.

 gnu/services/shepherd.scm | 9 +++++++++
 gnu/system/hurd.scm       | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)


base-commit: d14663b94a7428eccbfa27aa620dc3d8ba67d752
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#77943; Package guix-patches. (Sun, 20 Apr 2025 15:56:04 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 77943 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Yelninei <yelninei <at> tutamail.com>
Subject: [PATCH 1/2] services: shepherd: Provide the right #:kernel-log-file
 on the Hurd.
Date: Sun, 20 Apr 2025 17:54:46 +0200
* gnu/services/shepherd.scm (shepherd-system-log-service-type):
Pass #:kernel-log-file.

Reported-by: Yelninei <yelninei <at> tutamail.com>
Change-Id: I6f7a4b4e8e69a116069886e3879400d600645b30
---
 gnu/services/shepherd.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index c8e01c9d83..156a36c2da 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -781,6 +781,15 @@ (define shepherd-system-log-service-type
                                     (#f #~())
                                     (value #~(#:message-destination #$value)))
 
+                               ;; The Shepherd <= 1.0.4 chooses /proc/kmsg
+                               ;; unconditionally.  Fix that.
+                               #:kernel-log-file
+                               (cond ((string-contains %host-type "linux") ;Linux
+                                      "/proc/kmsg")
+                                     ((string-suffix? "-gnu" %host-type) ;GNU/Hurd
+                                      "/dev/klog")
+                                     (else #f))
+
                                #:date-format #$date-format
                                #:history-size #$history-size
                                #:max-silent-time #$max-silent-time)))))
-- 
2.49.0





Information forwarded to janneke <at> gnu.org, guix-patches <at> gnu.org:
bug#77943; Package guix-patches. (Sun, 20 Apr 2025 15:56:05 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 77943 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 2/2] system: hurd: Switch to the Shepherd’s system log.
Date: Sun, 20 Apr 2025 17:54:47 +0200
This is a followup to 8492a3c8962664db4bd0e7475f63be0ef59db87a.

* gnu/system/hurd.scm (%base-services/hurd): Replace
‘syslog-service-type’ by ‘shepherd-system-log-service-type’.

Change-Id: I3e12087a04f06210bd10b649b29fcf9949c5aa35
---
 gnu/system/hurd.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index c9df366f24..96b6a9a290 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2020-2024 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2020-2025 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -100,7 +100,7 @@ (define %base-services/hurd
                          `(("/bin/sh" ,(file-append bash "/bin/sh"))
                            ("/usr/bin/env" ,(file-append coreutils
                                                          "/bin/env"))))
-                (service syslog-service-type))
+                (service shepherd-system-log-service-type))
           (map (lambda (n)
                  (service hurd-getty-service-type
                           (hurd-getty-configuration
-- 
2.49.0





This bug report was last modified 3 days ago.

Previous Next


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