]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: when we can't log to journal, remember our fallback log target
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Fri, 26 Jan 2018 22:47:16 +0000 (22:47 +0000)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Fri, 26 Jan 2018 22:47:16 +0000 (22:47 +0000)
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 :).

src/core/manager.c

index bed52aa42e253f2a24e7b33f17bbd884b8bfe435..4a78bfb09f7f5fc2027b8eaea7dd374e3885f13f 100644 (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();
         }
 }