[systemd-devel] [PATCH] journald: check if socket is in connected state before forwarding to syslog
Piotr Wilczek
p.wilczek at samsung.com
Mon Jul 21 04:04:00 PDT 2014
On 07/11/2014 01:16 PM, Lennart Poettering wrote:
> On Fri, 11.07.14 13:02, Piotr Wilczek (p.wilczek at samsung.com) wrote:
>
>>> B) Now, as a shortcut we use the same sock actually, via sendto() to
>>> also pass data to /run/systemd/journal/syslog, which is where a
>>> secondary syslog server should listen on, which will then also receieve
>>> the data. THis one is likely to fail, because journald starts very
>>> early, and syslog daemons start very late, hence for the initial time
>>> no message can be delivered at all. Moreover, in many setups there is
>>> no secondary syslog, so this will fail each and every single time, but
>>> that's intended really.
>>>
>>> Now, your patch apparently looks for errors wth step A), and you argue
>>> you want to get rid of CPU load of B), which I can't follow. Since A
>>> and B are actually kinda separate they just happen to use the same
>>> socket, because that was easier...
>>>
>>
>> The CPU load is higher becouse now messages are sent to a socket that is not
>> in a connected state. I wanted to avoid that with the present
>> configuration.
>
> Hmm? Why does that create higher CPU load, and also what does "connected
> state" mean event? It's a SOCK_DGRAM socket, and your code changed the
> listening bit, event though you say the sending bit is the one that
> costs?
>
> Still not grokking at wall what you want to do...
>
The CPU usage is to prepare, send and (maybe) handle sending error. All
unnecessary because we (and apparently others) don't need it.
I wanted to automatically disable it on error but in wrong way so
scratch it.
It would be the best to disable forwarding to syslog by default.
Piotr
> Lennart
>
More information about the systemd-devel
mailing list