<p dir="ltr">FIFOs aren't sockets – they do not have an equivalent to accept() and there is no multiplexing of inputs; all writes to the FIFO immediately go to the "listening" file descriptor. So it's almost more like a datagram socket than a stream one, in a sense.</p>
<p dir="ltr">If you want a true socket that's filesystem-based, create a Unix socket by specifying the path via ListenStream, then connect to it using nc -U.</p>
<br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 5, 2024, 13:38 Steve Traylen <<a href="mailto:steve.traylen@cern.ch">steve.traylen@cern.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Was trying to set up a trivial socket and service to process multiple <br>
inputs:<br>
<br>
# Socket emailoutput.socket<br>
[Unit]<br>
Description=Send email via a socket.<br>
<br>
[Socket]<br>
Accept=yes<br>
ListenFIFO=/run/emailoutput.socket<br>
<br>
# Service emailoutput@.service<br>
[Unit]<br>
Description=email<br>
<br>
[Service]<br>
ExecStart=/usr/bin/mailx -s 'Testing from socket' <a href="mailto:steve@example.ch" target="_blank" rel="noreferrer">steve@example.ch</a><br>
StandardInput=socket<br>
<br>
<br>
Starting the socket always produces: "Unit configured for accepting <br>
sockets, but sockets are non-accepting. Refusing"<br>
<br>
Switching the socket to "ListenStream=<a href="http://127.0.0.1:9999" rel="noreferrer noreferrer" target="_blank">127.0.0.1:9999</a>" then everything <br>
works I can netcat files into the network socket.<br>
Is it impossible to to Accept=yes with ListenFIFO?<br>
<br>
<br>
Motivation for was this i wanted to do perform a systemd-run of a <br>
command outputting to that socket to pipe it into mailx.<br>
<br>
<br>
</blockquote></div>