[systemd-bugs] [Bug 84604] RFE: core: we should have a way to make failed listening on specific ports in .socket non-fatal, via a syntax of ListenStream=-[::]:4711

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Oct 20 16:30:56 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=84604

Lennart Poettering <lennart at poettering.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|systemd.socket unit bind    |RFE: core: we should have a
                   |with AF_INET6 on IPv4 ports |way to make failed
                   |(cups)                      |listening on specific ports
                   |                            |in .socket non-fatal, via a
                   |                            |syntax of
                   |                            |ListenStream=-[::]:4711

--- Comment #5 from Lennart Poettering <lennart at poettering.net> ---
So, systemd currently doesn't support this scheme nicely. We should however. 

The ipv6only compat stuff is you really should set to "on" for cups. CUPS
appears to require that, and that's probably a really good idea for it.

Now, to achieve what you want, you should use:

ListenStream=0.0.0.0:631
ListenStream=[::]:631

both lines listed in the same .socket file. The first line will listen on the
IPv4 port 631 on all interfaces, the second line on the IPv6 port 631. Now,
there's one problem with this: the latter line will cause the .socket unit to
fail on kernels where ipv6 is not compiled in. The question now is what to do
about this.

We have two options:

1) introduce a syntax "ListenStream=-[::]:631" (i.e. note the "-"), which would
tell systemd that failure to listen on that port shall not be considered fatal.
This would then be similar to our "ExectStart=-/bin/false" syntax, where the
dash encodes that the exit cause for the process shall be ignored. 

2) change the logic of .socket units to succeed if we managed to listen on at
least *one* of all of its specified ports. Currently we fail if at least one
listening fails, and we'd turn this around so that we'd succeed if at least one
listening succeeds.

I think option #1 is preferable here though, simply because we normally should
guarantee stability of the order of fds we pass to the processes we invoke. By
specifying the dash, the user tells us that it is OK if an fd might be missing
when passed to the process. But just doing that by default sounds really ill
advised.

Does that make sense?

Renaming the bug accordingly.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20141020/162bd260/attachment.html>


More information about the systemd-bugs mailing list