All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] sysklogd: enable journal forwarding to syslog.socket
@ 2026-11-16  9:21 ecordonnier
  2026-11-16  9:21 ` [PATCH 2/2] systemd-conf: stop forwarding journal to syslog by default ecordonnier
  0 siblings, 1 reply; 2+ messages in thread
From: ecordonnier @ 2026-11-16  9:21 UTC (permalink / raw)
  To: openembedded-core; +Cc: Etienne Cordonnier

From: Etienne Cordonnier <ecordonnier@snap.com>

With systemd, syslogd.service requires syslog.socket and reads the
messages that journald forwards to it, which only happens with
ForwardToSyslog=yes. Install a journald drop-in enabling it so the
daemon keeps working once systemd-conf stops enabling it for every
image.

Tested on qemux86-64 with systemd: "logger" messages reach
/var/log/messages with the drop-in and are not logged without it.

AI-Generated: Uses Claude Code (claude-sonnet-5-5)
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
---
 meta/recipes-extended/sysklogd/sysklogd/50-sysklogd.conf | 2 ++
 meta/recipes-extended/sysklogd/sysklogd_2.8.0.bb         | 9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/sysklogd/sysklogd/50-sysklogd.conf

diff --git a/meta/recipes-extended/sysklogd/sysklogd/50-sysklogd.conf b/meta/recipes-extended/sysklogd/sysklogd/50-sysklogd.conf
new file mode 100644
index 0000000000..29a7331b3c
--- /dev/null
+++ b/meta/recipes-extended/sysklogd/sysklogd/50-sysklogd.conf
@@ -0,0 +1,2 @@
+[Journal]
+ForwardToSyslog=yes
diff --git a/meta/recipes-extended/sysklogd/sysklogd_2.8.0.bb b/meta/recipes-extended/sysklogd/sysklogd_2.8.0.bb
index 79e2612653..762bf33504 100644
--- a/meta/recipes-extended/sysklogd/sysklogd_2.8.0.bb
+++ b/meta/recipes-extended/sysklogd/sysklogd_2.8.0.bb
@@ -12,6 +12,7 @@ inherit update-rc.d update-alternatives systemd autotools
 
 SRC_URI = "git://github.com/troglobit/sysklogd.git;branch=v2.x;protocol=https;tag=v${PV} \
            file://sysklogd \
+           file://50-sysklogd.conf \
            "
 
 SRCREV = "e2c0c1d9585e88b1a85e3634c4dc230517f68f0e"
@@ -23,6 +24,12 @@ do_install:append () {
        install -m 644 ${S}/syslog.conf ${D}${sysconfdir}/syslog.conf
        install -d ${D}${sysconfdir}/init.d
        install -m 755 ${UNPACKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
+
+       # syslogd.service reads syslog.socket, which journald only feeds
+       # when ForwardToSyslog is enabled.
+       if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+               install -D -m 644 ${UNPACKDIR}/50-sysklogd.conf ${D}${systemd_unitdir}/journald.conf.d/50-sysklogd.conf
+       fi
 }
 
 SYSTEMD_PACKAGES = "${PN}"
@@ -33,7 +40,7 @@ INITSCRIPT_NAME = "syslog"
 CONFFILES:${PN} = "${sysconfdir}/syslog.conf"
 RCONFLICTS:${PN} = "rsyslog busybox-syslog syslog-ng"
 
-FILES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/sysklogd.conf', '', d)}"
+FILES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/sysklogd.conf ${systemd_unitdir}/journald.conf.d/50-sysklogd.conf', '', d)}"
 
 ALTERNATIVE_PRIORITY = "100"
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] systemd-conf: stop forwarding journal to syslog by default
  2026-11-16  9:21 [PATCH 1/2] sysklogd: enable journal forwarding to syslog.socket ecordonnier
@ 2026-11-16  9:21 ` ecordonnier
  0 siblings, 0 replies; 2+ messages in thread
From: ecordonnier @ 2026-11-16  9:21 UTC (permalink / raw)
  To: openembedded-core; +Cc: Etienne Cordonnier

From: Etienne Cordonnier <ecordonnier@snap.com>

ForwardToSyslog=yes was added in 2014 (67ddca4a55) as a stopgap
because systemd 216 stopped forwarding by default and the oeqa tests
then expected a syslog daemon to receive messages. The tests now fall
back to journalctl, so the override is no longer needed.

On images without a syslog daemon, journald still formats and tries to
forward every message to syslog for nothing, wasting CPU. Images running
a syslog daemon that reads /dev/log must now enable ForwardToSyslog
themselves.

AI-Generated: Uses Claude Code (claude-sonnet-5-5)
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
---
 meta/recipes-core/systemd/systemd-conf/journald.conf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meta/recipes-core/systemd/systemd-conf/journald.conf b/meta/recipes-core/systemd/systemd-conf/journald.conf
index fd4d969fa7..750fb2f5e8 100644
--- a/meta/recipes-core/systemd/systemd-conf/journald.conf
+++ b/meta/recipes-core/systemd/systemd-conf/journald.conf
@@ -1,3 +1,2 @@
 [Journal]
-ForwardToSyslog=yes
 RuntimeMaxUse=64M
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-16  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16  9:21 [PATCH 1/2] sysklogd: enable journal forwarding to syslog.socket ecordonnier
2026-11-16  9:21 ` [PATCH 2/2] systemd-conf: stop forwarding journal to syslog by default ecordonnier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.