<html> <head> <title>tcpsvd(8) manual page</title> </head> <body bgcolor='white'> <a href='http://smarden.org/pape/'>G. Pape</a><br><a href='index.html'>ipsvd</a><hr> <h2><a name='sect0'>Name</a></h2> tcpsvd - TCP/IP service daemon <h2><a name='sect1'>Synopsis</a></h2> <b>tcpsvd</b> [-hpEvv] [-c <i>n]</i> [-C <i>n:<i>msg</i>]</i> [-b <i>n]</i> [-u <i>user]</i> [-l <i>name]</i> [-i <i>dir</i>|-x <i>cdb</i>] [ -t <i>sec</i>] <i>host</i> <i>port</i> <i>prog</i> <h2><a name='sect2'>Description</a></h2> <b>tcpsvd</b> creates a TCP/IP socket, binds it to the address <i>host</i>:<i>port</i>, and listens on the socket for incoming connections. <p> On each incoming connection, <b>tcpsvd</b> conditionally runs a program, with standard input reading from the socket, and standard output writing to the socket, to handle this connection. <b>tcpsvd</b> keeps listening on the socket for new connections, and can handle multiple connections simultaneously. <p> <b>tcpsvd</b> optionally checks for special instructions depending on the IP address or hostname of the client that initiated the connection, see <i><b>ipsvd-instruct</b>(5)</i>. <h2><a name='sect3'>Options</a></h2> <dl> <dt><i>host</i> </dt> <dd><i>host</i> either is a hostname, or a dotted-decimal IP address, or 0. If <i>host</i> is 0, <b>tcpsvd</b> accepts connections to any local IP address. </dd> <dt><i>port</i> </dt> <dd><b>tcpsvd</b> accepts connections to <i>host</i>:<i>port</i>. <i>port</i> may be a name from /etc/services or a number. </dd> <dt><i>prog</i> </dt> <dd><i>prog</i> consists of one or more arguments. For each connection, <b>tcpsvd</b> normally runs <i>prog</i>, with file descriptor 0 reading from the network, and file descriptor 1 writing to the network. By default it also sets up TCP-related environment variables, see <i><b>tcp-environ</b>(5)</i> </dd> <dt><b>-i <i>dir</b> </i></dt> <dd>read instructions for handling new connections from the instructions directory <i>dir</i>. See <i><b>ipsvd-instruct</b>(5)</i> for details. </dd> <dt><b>-x <i>cdb</b> </i></dt> <dd>read instructions for handling new connections from the constant database <i>cdb</i>. The constant database normally is created from an instructions directory by running <i><b>ipsvd-cdb</b>(8)</i>. </dd> <dt><b>-t <i>sec</b> </i></dt> <dd>timeout. This option only takes effect if the -i option is given. While checking the instructions directory, check the time of last access of the file that matches the clients address or hostname if any, discard and remove the file if it wasn’t accessed within the last <i>sec</i> seconds; <b>tcpsvd</b> does not discard or remove a file if the user’s write permission is not set, for those files the timeout is disabled. Default is 0, which means that the timeout is disabled. </dd> <dt><b>-l <i>name</b> </i></dt> <dd>local hostname. Do not look up the local hostname in DNS, but use <i>name</i> as hostname. This option must be set if <b>tcpsvd</b> listens on port 53 to avoid loops. </dd> <dt><b>-u <i>user</i>[:<i>group</i>]</b> </dt> <dd>drop permissions. Switch user ID to <i>user</i>’s UID, and group ID to <i>user</i>’s primary GID after creating and binding to the socket. If <i>user</i> is followed by a colon and a group name, the group ID is switched to the GID of <i>group</i> instead. All supplementary groups are removed. </dd> <dt><b>-c <i>n</b> </i></dt> <dd>concurrency. Handle up to <i>n</i> connections simultaneously. Default is 30. If there are <i>n</i> connections active, <b>tcpsvd</b> defers acceptance of a new connection until an active connection is closed. </dd> <dt><b>-C <i>n</i>[:<i>msg</i>]</b> </dt> <dd>per host concurrency. Allow only up to <i>n</i> connections from the same IP address simultaneously. If there are <i>n</i> active connections from one IP address, new incoming connections from this IP address are closed immediately. If <i>n</i> is followed by :<i>msg,</i> the message <i>msg</i> is written to the client if possible, before closing the connection. By default <i>msg</i> is empty. See <i><b>ipsvd-instruct</b>(5)</i> for supported escape sequences in <i>msg</i>. <p> For each accepted connection, the current per host concurrency is available through the environment variable <i>TCPCONCURRENCY</i>. <i>n</i> and <i>msg</i> can be overwritten by <i><b>ipsvd</b>(7)</i> instructions, see <i><b>ipsvd-instruct</b>(5)</i>.<b></b> By default <b>tcpsvd</b> doesn’t keep track of connections. </dd> <dt><b>-h</b> </dt> <dd>Look up the client’s hostname in DNS. </dd> <dt><b>-p</b> </dt> <dd>paranoid. After looking up the client’s hostname in DNS, look up the IP addresses in DNS for that hostname, and forget about the hostname if none of the addresses match the client’s IP address. You should set this option if you use hostname based instructions. The -p option implies the -h option. </dd> <dt><b>-b <i>n</b> </i></dt> <dd>backlog. Allow a backlog of approximately <i>n</i> TCP SYNs. On some systems <i>n</i> is silently limited. Default is 20. </dd> <dt><b>-E</b> </dt> <dd>no special environment. Do not set up TCP-related environment variables. </dd> <dt><b>-v</b> </dt> <dd>verbose. Print verbose messsages to standard output. </dd> <dt><b>-vv</b> </dt> <dd>more verbose. Print more verbose messages to standard output. </dd> </dl> <h2><a name='sect4'>See Also</a></h2> <i>ipsvd(7)</i>, <i>sslsvd(8)</i>, <i>udpsvd(8)</i>, <i>ipsvd-instruct(5)</i>, <i>ipsvd-cdb(8)</i>, <i>sslio(8)</i> <p> <i>http://smarden.org/ipsvd/</i> <h2><a name='sect5'>Author</a></h2> Gerrit Pape <pape@smarden.org> <p> <hr><p> <a name='toc'><b>Table of Contents</b></a><p> <ul> <li><a name='toc0' href='#sect0'>Name</a></li> <li><a name='toc1' href='#sect1'>Synopsis</a></li> <li><a name='toc2' href='#sect2'>Description</a></li> <li><a name='toc3' href='#sect3'>Options</a></li> <li><a name='toc4' href='#sect4'>See Also</a></li> <li><a name='toc5' href='#sect5'>Author</a></li> </ul> </body> </html>