mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 14:40:31 +00:00
journal: Don't discard kmsg messages coming from journald itself
Previously, we discarded any kmsg messages coming from journald itself to avoid infinite loops where potentially the processing of a kmsg message causes journald to log one or more messages to kmsg which then get read again by the kmsg handler, ... However, if we completely disable logging whenever we're processing a kmsg message coming from journald itself, we also prevent any infinite loops as we can be sure that journald won't accidentally generate logging messages while processing a kmsg log message. This change allows us to store all journald logs generated during the processing of log messages from other services in the system journal. Previously these could only be found in kmsg which has low retention, can't be queried using journalctl and whose logs don't survive reboots.
This commit is contained in:
@@ -27,6 +27,10 @@ typedef enum LogTarget{
|
||||
_LOG_TARGET_INVALID = -EINVAL,
|
||||
} LogTarget;
|
||||
|
||||
/* This log level disables logging completely. It can only be passed to log_set_max_level() and cannot be
|
||||
* used a regular log level. */
|
||||
#define LOG_NULL (LOG_EMERG - 1)
|
||||
|
||||
/* Note to readers: << and >> have lower precedence than & and | */
|
||||
#define SYNTHETIC_ERRNO(num) (1 << 30 | (num))
|
||||
#define IS_SYNTHETIC_ERRNO(val) ((val) >> 30 & 1)
|
||||
|
||||
Reference in New Issue
Block a user