[systemd-devel] Forwarding early boot messages to rsyslog

Lennart Poettering lennart at poettering.net
Tue Jan 22 16:46:55 PST 2013


On Tue, 22.01.13 18:25, Scott Shambarger (scott-systemd at shambarger.net) wrote:

> 
> (oops, forgot to reply-all :)
> 
> On 2013-01-22 17:14, Lennart Poettering wrote:
> >On Tue, 22.01.13 16:55, Scott Shambarger
> >(scott-systemd at shambarger.net) wrote:
> >>Agreed, however I'd like to suggest another possibility.  Perhaps
> >>journalctl could add an option to output to a syslog socket (say
> >>here /run/systemd/journal/syslog-pre) with all the metadata that
> >>journald already provides on forwarded messages... that way I could
> >>add a ExecStartPre entry that could background the journalctl dump;
> >>I could then have a rsyslog module that preloads from syslog-pre,
> >>and then rsyslog could continue on it's merry way. (A wrapper could
> >>even unlink syslog-pre after journalctl is finished with it).
> >
> >We have such a queue already, it's the journal itself, and there's an
> >API for it (see above).
> >
> 
> True, I was just thinking of a enhancing journalctl (using existing
> journald behavior) to provide the ability to feed syslog messages to
> any logger without the need to write an independent tool (which
> would not be part of systemd) or an extension for each and every
> legacy syslogger.
> 
> Something akin to:
> 
> journalctl --to-syslog <socket-name>

I think we shouldn't try this. The protocol is so weakly defined, we
really don't want to tap can of worms. If you start doing this then
we'll get requests for different formats, to support this sw and that
other sw and this third sw, and that will never stop. We already forward
things to a local syslog, and do this exactly to the level glibc did,
and I am pretty sure all other glue should live on rsyslog's side, not
ours.

> which could then take advantage of all the existing filtering and
> source merging that journalctl already provides (without having to
> re-implement it all).

Well the filtering is all in the library. Most of the journalctl are
just directly translated to C API calls.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list