[systemd-devel] Getting EOF on FD#1 stdout (a service using socat)

Mantas Mikulėnas grawity at gmail.com
Mon Jul 27 03:46:55 PDT 2015


On Mon, Jul 27, 2015 at 1:31 PM, John Lane <systemd at jelmail.com> wrote:

> I have a problem with what I thought would be a simple service unit:
>
>     # /etc/systemd/system/socat.service
>     [Service]
>     ExecStart=/usr/bin/socat UDP-RECV:4321 STDOUT
>
> The expected outcome is that "/usr/bin/socat UDP-RECV:4321 STDOUT" is
> started with its standard output connected to the journal.
>
> However, the service terminates immediately without error. I've looked
> into it and notice that socat is getting an EOF on FD#1, its standard
> output, and it then terminates:
>
>     N starting data transfer loop with FDs [5,5] and [1,1]
>     N socket 2 (fd 1) is at EOF
>     I close(5)
>     N exiting with status 0
>

socat uses bidirectional streams by default, so if it says it hit EOF on
"STDOUT", maybe it's treating it as alias to "STDIO" by default?

Try using `socat -u` for unidirectional mode.

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150727/ac76fff5/attachment.html>


More information about the systemd-devel mailing list