S6-TCPSERVERD(8)

NAME
s6-tcpserverd - the serving part of the s6-tcpserver(8) super-server

SYNOPSIS
s6-tcpserverd s6-tcpserverd [-1] [-v verbosity] [-c maxconn] file ... -C localmaxconn prog...

DESCRIPTION
s6-tcpserverd is the serving part of the s6-tcpserver(8) super-server. It assumes that its stdin is a bound and listening TCP/IP socket, and it accepts connections from clients connecting to it, spawning a program to handle each connection.

s6-tcpserverd accepts connections from clients to an already bound and listening TCP socket which is its standard input.

For every TCP connection to this socket, it spawns a prog... child with stdin reading from the network socket and stdout writing to it.

Depending on the verbosity level, it logs what it does to stderr.

It runs until killed by a signal. Depending on the received signal, it may kill its children before exiting.

Unlike its ancestor tcpserver[1], s6-tcpserverd performs just the bare minimum: the point is to have a small and very fast process to serve connections with the least possible overhead. Features such as access control and DNS resolution are provided via the s6-tcpserver-access(8) program.

s6-tcpserverd is meant to be execve(2)' d into by a program that gets the listening socket. That program is normally s6-tcpserver-socketbinder(8), which creates the socket itself; but it can be a different one if the socket is to be retrieved by another means, for instance by fd-passing from a fd-holding daemon ( some people call this “socket activation”).

The option to make s6-tcpserverd verbose is ‘-v 2’, where the verbosity level is given as an argument, 0 being quiet, 1 normal and 2 verbose. This is different from the s6-tcpserver(8) interface, where ‘-v’ without an argument would indicate extra verbosity. The difference exists because s6-tcpserver(8) follows the UCSPI tool[2] interface, whereas s6-tcpserverd has no such constraint, and giving the verbosity level as a number is a better interface.

  Signals

SIGTERM
    Exit.

SIGHUP
    Send a SIGTERM and a SIGCONT to all children.

SIGQUIT
    Send a SIGTERM and a SIGCONT to all children, then exit.

SIGABRT
    Send a SIGKILL to all children, then exit.

OPTIONS

-1  Write the local port, followed by newline, to stdout, and close stdout, right before entering the client-accepting loop. If stdout is suitably redirected, this can be used by monitoring programs to check when the server is accepting connections. This can be used with s6's s6-notifywhenup(7) readiness notification mechanism to make sure subsequent services do not start before the server is ready.

-v verbosity
    Be more or less verbose. By default, verbosity is 1: print warning messages to stderr. 0 means only print fatal error messages; 2 means print status and connection information for every client.

-c maxconn
    Accept at most maxconn concurrent connections. Default is 40. It is impossible to set it higher than 16384.

-C localmaxconn
    Accept at most localmaxconn connections from the same IP address. Default is 40. It is impossible to set it higher than maxconn.

ENVIRONMENT
For each connection, an instance of prog... is spawned with the following variables set:

PROTO
    Always set to TCP.

TCPLOCALIP
    Set to the server socket's address.

TCPLOCALPORT
    Set to the server socket's port.

TCPREMOTEIP
    Set to the client socket's address.

TCPREMOTEPORT
    Set to the client socket's port.

TCPCONNNUM
    Set to the number of connections originating from the same IP address.

SEE ALSO
execve(2), s6-notifywhenup(7), s6-tcpclient(8), s6-tcpserver(8), s6-tcpserver-access(8), s6-tcpserver-socketbinder(8)

[1] https://cr.yp.to/ucspi-tcp/tcpserver.html

[2] https://cr.yp.to/proto/ucspi.txt

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-networking/s6-tcpserverd.html

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)