diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-01-24 17:36:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-01-24 18:22:56 +0100 |
commit | adf47c919abbd62e287ebaad9e2ade38ce66dcbf (patch) | |
tree | 1c2a64892c1535ba50d64f6dde6329958a5bb699 /src/basic/log.h | |
parent | log: make log_set_upgrade_syslog_to_journal() take effect immediately (diff) | |
download | systemd-adf47c919abbd62e287ebaad9e2ade38ce66dcbf.tar.xz systemd-adf47c919abbd62e287ebaad9e2ade38ce66dcbf.zip |
log: add new "prohibit_ipc" flag to logging system
If set, we'll avoid logging to any IPC log targets, i.e. syslog or the
journal, but allow stderr, kmsg, console logging.
This is useful as PID 1 wants to turn this off explicitly as long as the
journal is not up.
Previously we'd open/close the log stream to these services whenever
needed but this is incompatible with the "open_when_needed" logic
introduced in #6915, which might open the log streams whenever it likes,
including possibly inside of the child process we fork off that'll
become journald later on. Hence, let's make this all explicit, and
instead of managing when we open/close log streams add a boolean that
clearly prohibits the IPC targets when needed, so that opening can be
done at any time, but will honour this.
See: #7985
Diffstat (limited to '')
-rw-r--r-- | src/basic/log.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/log.h b/src/basic/log.h index 910a89a255..0a8fa22866 100644 --- a/src/basic/log.h +++ b/src/basic/log.h @@ -307,6 +307,10 @@ void log_set_upgrade_syslog_to_journal(bool b); void log_set_always_reopen_console(bool b); void log_set_open_when_needed(bool b); +/* If turned on, then we'll never use IPC-based logging, i.e. never log to syslog or the journal. We'll only log to + * stderr, the console or kmsg */ +void log_set_prohibit_ipc(bool b); + int log_syntax_internal( const char *unit, int level, |