tcpsvd(8)
π tcpsvd(8) β bestie edition π
okay so we're in the System Manager's Manual section 8, and this page is about tcpsvd, the TCP/IP service daemon. it's giving "the bouncer at the club door but for sockets". let's go π«Ά
β¨ NAME β¨
tcpsvd β TCP/IP service daemon
like. that's it. that's the whole name. short, iconic, no notes. π
πΈ SYNOPSIS πΈ
tcpsvd [-hpEvv] [-c n] [-C n:msg] [-b n] [-u user] [-l name] [-i dir|-x
cdb] [ -t sec] host port prog
π¦ DESCRIPTION π¦
so here's the tea, bestie: tcpsvd makes a TCP/IP socket, binds it to the address host:port, and then just... sits there. listening. on the socket. waiting for incoming connections like a girl waiting for a text back. π
on each incoming connection, tcpsvd conditionally runs a program β and the way it does this is so clever: standard input reads from the socket, standard output writes to the socket, and that program handles that one connection. then tcpsvd keeps listening for new connections, and it can handle multiple connections at the same time. multitasking queen. π
also tcpsvd can optionally check for special instructions that depend on the IP address or hostname of the client who started the connection. see ipsvd-instruct(5) for that whole situation.
π OPTIONS π
hostβ this can be a hostname, or a dotted-decimal IP address, or0. ifhostis0, thentcpsvdaccepts connections to any local IP address. no pickiness. she's flexible.portβtcpsvdaccepts connections tohost:port. andportcan be a name from/etc/servicesor just a number. either one, we don't gatekeep.progβprogis one or more arguments. for each connection,tcpsvdnormally runsprog, with file descriptor0reading from the network, and file descriptor1writing to the network. and by default it also sets up TCP-related environment variables β seetcp-environ(5)for the details.-i dirβ read instructions for handling new connections from the instructions directorydir. seeipsvd-instruct(5)for the full breakdown.-x cdbβ read instructions for handling new connections from the constant databasecdb. normally that constant database is created from an instructions directory by runningipsvd-cdb(8). pipeline behavior fr fr.-t secβ timeout. important caveat bestie: this option only takes effect if the-ioption is given. while checking the instructions directory,tcpsvdchecks the time of last access of the file that matches the client's address or hostname, if there is one, and it discards and removes the file if it wasn't accessed within the lastsecseconds. BUT βtcpsvddoes not discard or remove a file if the user's write permission is not set; for those files, the timeout is disabled. default is0, which means the timeout is disabled. so0= off, periodt.-l nameβ local hostname. don't look up the local hostname in DNS, just usenameas the hostname. and listen: this option must be set iftcpsvdlistens on port53, to avoid loops. not optional. do not skip it. π-u [:]user[:group]β drop permissions. set uid and gid to the user's uid and gid, as found in/etc/passwd, before runningprog. ifuseris followed by a colon and a group, set the gid togroup's gid, as found in/etc/group, instead of the user's gid. ifgroupconsists of a colon-separated list of group names, set the group ids of all the listed groups. and ifuseris prefixed with a colon, theuserand all group arguments are interpreted as uid and gids respectively, and not looked up in the password or group file. also: all supplementary groups are removed. clean slate energy.-c nβ concurrency. handle up tonconnections simultaneously. default is30. if there arenconnections active,tcpsvddefers acceptance of a new connection until an active connection is closed. like a waitlist. the line is real. π-C n[:msg]β per host concurrency. allow only up tonconnections from the same IP address simultaneously. if there arenactive connections from one IP address, new incoming connections from this IP address are closed immediately. brutal? yes. necessary? also yes. ifnis followed by:msg, the messagemsgis written to the client if possible, before closing the connection. by defaultmsgis empty. seeipsvd-instruct(5)for supported escape sequences inmsg.
for each accepted connection, the current per host concurrency is available through the environment variable TCPCONCURRENCY. and n and msg can be overwritten by ipsvd(7) instructions β see ipsvd-instruct(5). by default tcpsvd doesn't keep track of connections. so if you want the tracking, you gotta ask for it.
-hβ look up the client's hostname in DNS. that's the whole thing. simple. slay.-pβ 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. and heads up: the-poption implies the-hoption. so it's a package deal.-b nβ backlog. allow a backlog of approximatelynTCP SYNs. on some systemsnis silently limited (rude, but okay). default is20.-Eβ no special environment. do not set up TCP-related environment variables. minimalism. π€-vβ verbose. print verbose messages to standard output. she's talking now.-vvβ more verbose. print more verbose messages to standard output. she is yapping. π
π SEE ALSO π
ipsvd(7), sslsvd(8), udpsvd(8), ipsvd-instruct(5), ipsvd-cdb(8), sslio(8)
π AUTHOR π
Gerrit Pape <pape@smarden.org> β thank you for the lore, king π«‘
and that's the whole page bestie, every last flag and file path, no cap. this was tcpsvd(8) from the System Manager's Manual β that's the source and the section and everything, so you know exactly where she came from. go handle some connections. i'm obsessed. β¨π¦π
π¦ where this page comes from
- debian bookworm: ipsvd 1.0.0-5
- debian trixie: ipsvd 1.0.0-12
- ubuntu jammy: ipsvd 1.0.0-3.1
- ubuntu noble: ipsvd 1.0.0-5
- ubuntu questing: ipsvd 1.0.0-12
- ubuntu resolute: ipsvd 1.0.0-12build1
- ubuntu stonking: ipsvd 1.0.0-12build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms