NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/59026: Not functional syslogd option -S Sync kernel messages to disk immediately.



>Number:         59026
>Category:       kern
>Synopsis:       Not functional syslogd option -S  Sync kernel messages to disk immediately.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 23 20:00:00 +0000 2025
>Originator:     Peter Skvarka
>Release:        10.1
>Organization:
Soft in Engines
>Environment:
NetBSD bsd.lan 10.1 NetBSD 10.1 (GENERIC)
>Description:
When syslogd is started with -S parameter (Sync kernel messages to disk immediately.) then it does not flush new messages from klog to syslog.
The reason are missing calls in src/sys/kern/subr_prf.c


>How-To-Repeat:
Start syslogd with -S switch. For example by adding syslogd_flags="-S" to rc.conf and reboot. 
Then try to run some kernel code with printf("some string"), for example create dummy kernel module which only loads and do print().
The message does not appear in /var/log/messages .

>Fix:
RVP provides patch:
https://mail-index.netbsd.org/tech-kern/2025/01/13/msg029950.html

---START PATCH---
--- src/sys/kern/subr_prf.c.orig	2023-08-29 21:23:14.000000000 +0000
+++ src/sys/kern/subr_prf.c	2025-01-13 08:37:45.789743655 +0000
@@ -1059,6 +1059,9 @@
 	va_start(ap, fmt);
 	vprintf_flags(TOLOG, fmt, ap);
 	va_end(ap);
+
+	if (!panicstr)
+		logwakeup();
 }

 /*
@@ -1104,6 +1107,9 @@
 	va_start(ap, fmt);
 	vprintf_flags(TOCONS | TOLOG, fmt, ap);
 	va_end(ap);
+
+	if (!panicstr)
+		logwakeup();
 }

 /*
---END PATCH---



Home | Main Index | Thread Index | Old Index