core: honor FileDescriptorName= too for Accept=yes sockets

So far we manually hardcoded $LISTEN_FDNAMES to "varlink" in various
varlink service units we ship, even though FileDescriptorName=varlink
is specified in associated socket units already, because
FileDescriptorName= is currently silently ignored when combined with
Accept=yes. Let's step away from this, which seems saner.

Note that this is technically a compat break, but a mostly negligible
one as there shall be few users setting FileDescriptorName= but
still expecting LISTEN_FDNAMES=connection in the actual executable.

Preparation for #34080
This commit is contained in:
Mike Yuan
2024-08-25 23:21:47 +02:00
parent 2234032c47
commit daa78907af
5 changed files with 28 additions and 22 deletions

View File

@@ -853,18 +853,15 @@
<varlistentry>
<term><varname>FileDescriptorName=</varname></term>
<listitem><para>Assigns a name to all file descriptors this
socket unit encapsulates. This is useful to help activated
services identify specific file descriptors, if multiple fds
are passed. Services may use the
<listitem><para>Assigns a name to all file descriptors this socket unit encapsulates.
This is useful to help activated services identify specific file descriptors, if multiple fds are passed.
Services may use the
<citerefentry><refentrytitle>sd_listen_fds_with_names</refentrytitle><manvolnum>3</manvolnum></citerefentry>
call to acquire the names configured for the received file
descriptors. Names may contain any ASCII character, but must
exclude control characters and <literal>:</literal>, and must
be at most 255 characters in length. If this setting is not
used, the file descriptor name defaults to the name of the
socket unit, including its <filename>.socket</filename>
suffix.</para>
call to acquire the names configured for the received file descriptors. Names may contain any ASCII character,
but must exclude control characters and <literal>:</literal>, and must be at most 255 characters in length.
If this setting is not used, the file descriptor name defaults to the name of the socket unit
(including its <filename>.socket</filename> suffix) when <varname>Accept=no</varname>,
<literal>connection</literal> otherwise.</para>
<xi:include href="version-info.xml" xpointer="v227"/></listitem>
</varlistentry>