[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Devuan Jessie beta released

Devuan Jessie beta released

Posted May 3, 2016 4:55 UTC (Tue) by dlang (guest, #313)
In reply to: Devuan Jessie beta released by anselm
Parent article: Devuan Jessie beta released

no, systemd doesn't just open the socket for the logging daemon to use later, it fires up the logging daemon which then opens the socket receives, buffers, and writes the log message.

systemd isn't magic, you can't just create a socket and have logging happen.


to post comments

Devuan Jessie beta released

Posted May 3, 2016 5:15 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link] (4 responses)

I was under impression that data is simply buffered in the default socket buffer? Attempting to read might be counter-productive because of all the possible complications with file descriptors and SCM_RIGHTS.

Devuan Jessie beta released

Posted May 3, 2016 5:20 UTC (Tue) by dlang (guest, #313) [Link] (3 responses)

nope, systemd starts journald which processes the message as it is written, does the SCM_CREDENTIALS looup, buffers the data, writes it to disk, and then listens for requests on another socket for things to read the logs.

As the final step it can also write the logs out to a syslog daemon, including forging the SCM_CREDENTIALS in the kernel so that the syslog daemon gets the correct info when it does the queries.

Nothing so mundane as simply buffering the data somewhere until later in the boot process when syslog gets around to reading it.

the kernel kbuf has been doing that buffering of logs to be read later for many years for kernel messages, systemd didn't need to do anything to make those reliable.

Devuan Jessie beta released

Posted May 3, 2016 5:22 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link] (2 responses)

Does it do this for all sockets? It makes sense for syslog, but I don't think you can do it with file descriptors.

Devuan Jessie beta released

Posted May 3, 2016 5:30 UTC (Tue) by dlang (guest, #313) [Link]

for other socket activation, systemd doesn't do anything with the data, it just hopes that the kernel buffers are large enough that the sender doesn't block too long while it starts up the daemon that will actually process the data.

This works fairly well when the thing being activated either isn't too complex, or is doing a complex enough task that the added delay on the first use doesn't add too much to the time (printing for example)

Devuan Jessie beta released

Posted May 3, 2016 7:22 UTC (Tue) by anselm (subscriber, #2796) [Link]

Here's Lennart Poettering on socket activation in systemd.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds