Skip to content

Commit

Permalink
Add docs for socket inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
waveform80 committed Feb 29, 2024
1 parent e9fea11 commit d3cd911
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/cli_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,28 @@ option. These definitions will augment (and override, where the serial number
is identical) those definitions provided by the configuration files.


Systemd/Inetd Usage
===================

The server may inherit its listening socket from a managing process. In the
case of :manpage:`inetd(8)` where the listening socket is traditionally passed
as stdin (fd 0), pass "stdin" as the value of :option:`--listen` (or the
``listen`` option within the ``[tftp]`` section of the configuration file).

In the case of :manpage:`systemd(1)`, where the listening socket(s) are passed
via the environment, specify "systemd" as the value of :option:`--listen` (or
the ``listen`` option within the ``[tftp]`` section of the configuration file)
and the service will expect to find a single socket passed in
:envvar:`LISTEN_FDS`. This will happen implicitly if the service is declared as
socket-activated. However, the service must *not* use ``Accept=yes`` as the
TFTP protocol is connection-less. The example units provided in the source code
demonstrate using socket-activation with the server.

In both cases, the service manager sets the port that the service will listen
on, so the :option:`--port` option (and the ``port`` option in the ``[tftp]``
section of the configuration file) is silently ignored.


See Also
========

Expand Down

0 comments on commit d3cd911

Please sign in to comment.