chiark / gitweb /
log: add new "prohibit_ipc" flag to logging system
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Jan 2018 16:36:25 +0000 (17:36 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:50:16 +0000 (07:50 +0200)
commit26d26c80c5d80515134e24e0e9829a39bf577dd0
treee8f1c3546f7bb11e3ffc9cd1186e98c0326618f7
parent50cac1201976fbf64285378b7d2422c758cef254
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
src/basic/log.c
src/basic/log.h