<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 27, 2021, 08:52 Nishant Nayan <<a href="mailto:nayan.nishant2000@gmail.com" target="_blank" rel="noreferrer">nayan.nishant2000@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have just started to learn journald and in its main function (in journald.c) I encountered a function call "log_set_prohibit_ipc(true);" <div>In systemd source, I can see the declaration in src/basic/log.h:/* </div><div><br></div><div>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);</div><div><br></div><div>I did not get this because Journald not writing to journal itself by default is strange, isn't it?</div><div>What is the reason behind it?<br></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">My understanding is that the point isn't to prevent logging to journal, but to prevent logging *through IPC* specifically, i.e. make sure journald doesn't try to create loopback connections to its own sockets. The journald daemon is single-threaded, so if it tries to connect to itself, it'll deadlock.</div><div dir="auto"><br></div><div dir="auto">But also if journald wants to log a critical error (e.g. running out of space or something like that), then it can't really *rely* on journal still working...</div><div dir="auto"><br></div><div dir="auto">Afaik, messages written to kmsg will be imported back into the journal anyway, but that happens asynchronously so it's fine.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>