[systemd-devel] [PATCH] journald: check if socket is in connected state before forwarding to syslog

Lennart Poettering lennart at poettering.net
Fri Jul 11 04:16:40 PDT 2014


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...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list