<div dir="auto">So then where does journald logs its own messages if he wants to?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 27 Aug 2021, 13:37 Lennart Poettering, <<a href="mailto:lennart@poettering.net">lennart@poettering.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fr, 27.08.21 10:01, Mantas Mikulėnas (<a href="mailto:grawity@gmail.com" target="_blank" rel="noreferrer">grawity@gmail.com</a>) wrote:<br>
<br>
> 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>><br>
> wrote:<br>
><br>
> > I have just started to learn journald and in its main function (in<br>
> > journald.c) I encountered a function call "log_set_prohibit_ipc(true);"<br>
> > In systemd source, I can see the declaration in src/basic/log.h:/*<br>
> ><br>
> > If turned on, then we'll never use IPC-based logging, * i.e. never log to<br>
> > syslog or the journal. We'll only * log to stderr, the console or kmsg<br>
> > */void log_set_prohibit_ipc(bool b);<br>
> ><br>
> > I did not get this because Journald not writing to journal itself by<br>
> > default is strange, isn't it?<br>
> > What is the reason behind it?<br>
> ><br>
><br>
> My understanding is that the point isn't to prevent logging to journal, but<br>
> to prevent logging *through IPC* specifically, i.e. make sure journald<br>
> doesn't try to create loopback connections to its own sockets. The journald<br>
> daemon is single-threaded, so if it tries to connect to itself, it'll<br>
> deadlock.<br>
><br>
> But also if journald wants to log a critical error (e.g. running out of<br>
> space or something like that), then it can't really *rely* on journal still<br>
> working...<br>
><br>
> Afaik, messages written to kmsg will be imported back into the journal<br>
> anyway, but that happens asynchronously so it's fine.<br>
<br>
The above describes exactly how it is, and why journald turns of<br>
logging via IPC. journald should not be a client to itself.<br>
<br>
Lennart<br>
<br>
--<br>
Lennart Poettering, Berlin<br>
</blockquote></div>