From: Alan Jenkins Date: Fri, 26 Jan 2018 22:47:16 +0000 (+0000) Subject: pid1: when we can't log to journal, remember our fallback log target X-Git-Tag: v237~6^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba307538994fb688284a13bb215267c3312bb5c7;p=platform%2Fupstream%2Fsystemd.git 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 :). --- diff --git a/src/core/manager.c b/src/core/manager.c index bed52aa..4a78bfb 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -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(); } }