Re: [systemd-devel] Redirecting logfile to journald

2016-07-25 Thread Lennart Poettering
On Mon, 25.07.16 00:55, Juanjo Presa (juan...@gmail.com) wrote:

> Hi, I'm running a service that only writes output to log file, not
> configurable. Then I'm trying to link the log file to /dev/stdout but I
> guess that is not enough to be received by journald because is not
> working.

Yes, this doesn't work right now, as the Linux kernel prohibits open()
on sockets, and systemd's service management connects stdout/stderr to
an AF_UNIX/SOCK_STREAM socket, and open("/dev/stdout") hence will
fail. There have been ideas how to fix that, and replace the socket by
a pipe, which would make this work, however so far nobody started
working on that. (patches very welcome!)

You could use a fifo in the file system as workound. Connect one side
to your app, and the other one to systemd-cat, and things should
work. But it isn't precisely pretty...

Sorry I don't have any better suggestion for you right now.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Redirecting logfile to journald

2016-07-24 Thread Juanjo Presa
Hi, I'm running a service that only writes output to log file, not
configurable. Then I'm trying to link the log file to /dev/stdout but I
guess that is not enough to be received by journald because is not working.

As I've read here: https://github.com/coreos/rkt/issues/2640 really
/dev/stdout is redirected to /proc/self/fd/1 and then to a journald
inaccesible socket.

Is there another way to feed journald?
Maybe an systemd-cat wrapper, but I'm trying hard to get rid of shell
scripts.

I'm running:

systemd 229
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
+GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN

Ubuntu 16.04.1 LTS (Xenial Xerus)

Thanks in advance.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel