Bug#964006: elogind: writes to kernel log
Thorsten Glaser
tg at mirbsd.de
Tue Jun 30 09:35:46 BST 2020
Package: elogind
Version: 243.7-1+debian1
Severity: normal
elogind pretends it’s the kernel. It must log to syslog instead.
If it uses systemd’s logging framework, the attached patch might help.
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'oldstable-updates'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'oldstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.6.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)
Versions of packages elogind depends on:
ii dbus 1.12.18-1
ii debconf 1.5.74
ii libacl1 2.2.53-8
ii libc6 2.30-8
ii libcap2 1:2.36-1
ii libelogind0 243.7-1+debian1
ii libselinux1 3.0-1+b3
ii libudev1 245.6-1
ii lsb-base 11.1.0
Versions of packages elogind recommends:
ii libpam-elogind 243.7-1+debian1
ii policykit-1 0.105-26
elogind suggests no packages.
-- Configuration Files:
/etc/elogind/logind.conf changed:
[Login]
HandlePowerKey=poweroff
HandleLidSwitch=lock
HandleLidSwitchExternalPower=lock
HandleLidSwitchDocked=lock
RemoveIPC=no
[Sleep]
-- no debconf information
-------------- next part --------------
diff -Nru systemd-241/debian/changelog systemd-241/debian/changelog
--- systemd-241/debian/changelog 2019-05-24 22:58:59.000000000 +0200
+++ systemd-241/debian/changelog 2019-05-29 15:10:29.000000000 +0200
@@ -1,3 +1,9 @@
+systemd (241-5tarent1) wtf; urgency=low
+
+ * Add patch to prefer syslog over kmsg for auto logging. (Closes: #923559)
+
+ -- Thorsten Glaser <t.glaser at tarent.de> Wed, 29 May 2019 15:10:29 +0200
+
systemd (241-5) unstable; urgency=medium
* Revert "Add check to switch VTs only between K_XLATE or K_UNICODE"
diff -Nru systemd-241/debian/patches/debian/Use-syslog-for-AUTO-logging-before-klog.patch systemd-241/debian/patches/debian/Use-syslog-for-AUTO-logging-before-klog.patch
--- systemd-241/debian/patches/debian/Use-syslog-for-AUTO-logging-before-klog.patch 1970-01-01 01:00:00.000000000 +0100
+++ systemd-241/debian/patches/debian/Use-syslog-for-AUTO-logging-before-klog.patch 2019-05-29 15:07:36.000000000 +0200
@@ -0,0 +1,32 @@
+# DP: make LOG_TARGET_AUTO fall back to syslog before kernel message buffer
+# DP: fixes #923559
+
+--- a/src/basic/log.c
++++ b/src/basic/log.c
+@@ -257,6 +257,7 @@ int log_open(void) {
+
+ if (!prohibit_ipc &&
+ IN_SET(log_target, LOG_TARGET_SYSLOG_OR_KMSG,
++ LOG_TARGET_AUTO,
+ LOG_TARGET_SYSLOG)) {
+ r = log_open_syslog();
+ if (r >= 0) {
+@@ -603,6 +604,7 @@ int log_dispatch_internal(
+ }
+
+ if (IN_SET(log_target, LOG_TARGET_SYSLOG_OR_KMSG,
++ LOG_TARGET_AUTO,
+ LOG_TARGET_SYSLOG)) {
+
+ k = write_to_syslog(level, error, file, line, func, buffer);
+--- a/src/basic/log.h
++++ b/src/basic/log.h
+@@ -30,7 +30,7 @@ typedef enum LogTarget{
+ LOG_TARGET_JOURNAL_OR_KMSG,
+ LOG_TARGET_SYSLOG,
+ LOG_TARGET_SYSLOG_OR_KMSG,
+- LOG_TARGET_AUTO, /* console if stderr is tty, JOURNAL_OR_KMSG otherwise */
++ LOG_TARGET_AUTO, /* console if stderr is tty, journal or syslog or kmsg otherwise */
+ LOG_TARGET_NULL,
+ _LOG_TARGET_MAX,
+ _LOG_TARGET_INVALID = -1
diff -Nru systemd-241/debian/patches/series systemd-241/debian/patches/series
--- systemd-241/debian/patches/series 2019-05-24 22:58:59.000000000 +0200
+++ systemd-241/debian/patches/series 2019-05-29 15:07:36.000000000 +0200
@@ -35,3 +35,4 @@
debian/Let-graphical-session-pre.target-be-manually-started.patch
debian/Add-env-variable-for-machine-ID-path.patch
debian/Drop-seccomp-system-call-filter-for-udev.patch
+debian/Use-syslog-for-AUTO-logging-before-klog.patch
More information about the Debian-init-diversity
mailing list