summaryrefslogtreecommitdiff
path: root/src/basic/log.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-01-24 17:36:25 +0100
committerLennart Poettering <lennart@poettering.net>2018-01-24 18:22:56 +0100
commitadf47c919abbd62e287ebaad9e2ade38ce66dcbf (patch)
tree1c2a64892c1535ba50d64f6dde6329958a5bb699 /src/basic/log.h
parent6fdb8de42fbd314f1d06019f9ba4c4a060898e5f (diff)
downloadsystemd-adf47c919abbd62e287ebaad9e2ade38ce66dcbf.tar.gz
systemd-adf47c919abbd62e287ebaad9e2ade38ce66dcbf.tar.bz2
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 'src/basic/log.h')
-rw-r--r--src/basic/log.h4
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,