1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

pid1: when we can't log to journal, remember our fallback log target

If we have to force the logging to close the journal fd, then we can open
any fallback log target.  E.g. kmsg, if the target was the default
JOURNAL_OR_KMSG.

This is the behaviour I would expect from the documentation.  I couldn't
find any justification in the code, for why we would want to start dropping
log messages instead of sending them to the fallback target.

This means we will match the behaviour of processes which we fork and which
set `open_when_needed`, and with generators - which use
log_set_prohibit_ipc(true) - which we fork+exec during a reload.

IMO this illustrates that the log_open/log_close interface is too clunky.
So with the behaviour settled, I will refactor the interface in the next
commit :).
This commit is contained in:
Alan Jenkins 2018-01-26 22:47:16 +00:00
parent 4c6ceea773
commit ba30753899

View File

@ -3550,6 +3550,7 @@ void manager_recheck_journal(Manager *m) {
* might trigger an activation ourselves we can't fulfill */
log_set_prohibit_ipc(true);
log_close_journal();
log_open();
}
}