[systemd-devel] Reusing stdout-syslog-bridge under sshd

Lennart Poettering lennart at poettering.net
Mon Sep 19 18:55:25 PDT 2011


On Wed, 07.09.11 19:36, Albert Strasheim (fullung at gmail.com) wrote:

> 
> Hello
> 
> On Wed, Sep 7, 2011 at 7:11 PM, Albert Strasheim <fullung at gmail.com> wrote:
> > Finally my question: is it possible for my custom shell to connect
> > stderr of bar to stdout-syslog-bridge? Is this feasible, or was
> > stdout-syslog-bridge designed to interact with systemd only?
> 
> Okay, wow, that was easy:
> 
> printf "syslog\n134\nbar\n1\n<134>VERY\nNICE\n" | strace -f socat
> STDIN UNIX-CONNECT:/run/systemd/logger
> 
> My custom shell can open the UNIX socket to /run/systemd/logger, prime
> the connection by setting up the facility, etc and then pass the
> socket as stderr to the program being run.
> 
> Could this interface be made part of the sd-daemon API? :-)

So, humm. Yeah, the above is certainly possible. But so far we consider
the socket interface private and it is nothing that is public API.

I think it would make a lot of sense however to provide something like:

  fd = sd_log_open("syslog", LOG_DEBUG);
  log = fdopen(fd, "w");
  fprintf(log, "Yippiediedoo\n");

or so which returns a fully set up fd to the logger bridge. This would
give you what you need, but give us the liberty to change the protocol
as we deem necessary.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list