Hi all,
I would like to ask you some information about logging scheme in poky
when journald is in.
Without journald, by default logs are handled by busybox-klogd and
busybox-syslogd: klogd forwards kernel logs to syslogd, and syslogd
writes kernel and userspace logs in /var/log/messages.
When journald comes in, it would centralize whole system logging to
itself, handling both kernel logs and userspace logs. For userspace
logs, it creates the /dev/log symlink that points to
/run/systemd/journal/dev-log (by systemd-journald-dev-log.socket), so
logs generated by the syslog API (that writes in /dev/log) should be
collected by journald.
In poky, journald is configured with "ForwardToSysLog=yes"
(meta/recipes-core/systemd/systemd-conf/journald.conf), then the
collected logs are forwarded to a syslog daemon through
/run/systemd/journal/syslog socket. Then it is expected that the syslog
daemon reads this socket.
Beside journald, busybox-syslogd and busybox-klogd are also started.
What I observe is:
- syslogd collects only some logs in /var/log/messages, seems only logs
from userspace (e.g. logs generated by logger command). These logs are
not collected by journald. Additionally, syslog is not collecting logs
that journald is forwarding
- journald emits "Forwarding to syslog missed X messages"
- klogd is useless: kernel logs are captured by journald, so it does
nothing. In fact, if I stop the service, kernel logs still be logged in
journal
Seems to me that first two issues happen because syslogd is listening
/dev/log (that journald would want for itself) instead of
/run/systemd/journal/syslog (socket prepared by journald to forward
logs): syslogd steals userspace logs from /dev/log (they don't reach
journald) and does not collect logs journald forwarded to
/run/systemd/journal/syslog.
So, as far as I understood, when journald is in, busybox-syslogd should
be patched to listen to /run/systemd/journal/syslog instead of /dev/log
(it is not possible to change this with config file or from build
configuration). With this modification, journald will collect also
userspace logs, and all (kernel + userspace) logs forwarded by journald
will be collected by busybox-syslogd, and saved in /var/log/messages.
Additionally, when journald is in, klogd should not be started.
Am I missing something? Or actual behavior is the desired one?
Sorry for the long mail.
Thanks in advance
--
Mauro S.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64271): https://lists.yoctoproject.org/g/yocto/message/64271
Mute This Topic: https://lists.yoctoproject.org/mt/109552039/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-