[systemd-devel] How to log to journald using fifo?

Lennart Poettering mzerqung at 0pointer.de
Thu Apr 14 09:30:38 UTC 2016


On Wed, 13.04.16 23:43, Samuel Williams (space.ship.traveller at gmail.com) wrote:

> I guess what I'm proposing is not a specific workaround but a way for
> legacy software which can only log to a file to get it's data into
> journald. There is plenty of software like that, unfortunately. It's a
> pragmatic option.
> 
> In this specific case, I'm referring to Nginx in daemon mode, which closes
> /dev/stderr as far as I can tell, and then spawns passenger, which can only
> log to a file. There is no way to hook up passenger to /dev/stderr.

Hmm, this might work: "touch /tmp/xxxx && mount --bind /proc/self/fd/2 /tmp/xxxx"

That will bind mount your fd 2 to /tmp/xxxx, and then you can reopen it from there later...

(Didn't try that this actually works, but I think this should pin the
open fd. YMMV.)

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list