ipsvd-instruct(5)
β¨ ipsvd-instruct(5) β¨
ok bestie, welcome to the File Formats Manual, section 5 β this one's all about the format of the ipsvd(8) instructions directory. no cap, it's giving very "small file, huge power" energy. π
πΈ NAME πΈ
ipsvd-instruct β the format of the ipsvd(8) instructions directory
π DESCRIPTION π
so the internet protocol service daemons, ipsvd(7), can be told to read and follow instructions from a directory whenever a connection comes in on the socket they're listening on. like, a little folder of vibes that decides what happens. ποΈ
and for mostly static instructions β or just for performance reasons β you can compile the instructions from a directory into a constant database (cdb) with ipsvd-cdb(8) for faster lookup, and then tell ipsvd(7) to read the instructions from there instead. glow up via precompilation, honestly. β‘
π¦ MATCHING π¦
on each incoming connection, ipsvd(7) matches the client's IP address against files in the instructions directory. example time: the IP address a.b.c.d, which reverse resolves to moa.bit.smarden.org, gets matched against the following files in the instructions directory, in this order β and first match wins, periodt:
a.b.c.da.b.ca.ba
and if the client's hostname has been successfully looked up in DNS:
moa.bit.smarden.orgbit.smarden.orgsmarden.orgorg
and finally, the catchall file 0 (zero):
0
after successfully matching a client's IP address or hostname against the instructions directory, ipsvd(7) examines the file that matched and acts accordingly:
- if neither the user's read permission nor the user's execute permission is set for the file, the connection is closed immediately. bye. π
- if the file has the user's execute permission set,
ipsvd(7)reads the contents of the file and runs/bin/sh -c '<contents>'instead of the default programproggiven at the command line for this connection. - if the file has the user's read permission set,
ipsvd(7)reads the contents of the file and interprets each line as an instruction for this connection (more on that below π).
and if the client's IP address or hostname doesn't match any file in the instructions directory? the default action is taken β the program prog is run to handle the connection. no drama. π
π INSTRUCTIONS π
if ipsvd(7) is given instructions for an incoming connection, it reads the corresponding file and interprets each line like this. the file may be empty, meaning that there is no special instruction. (empty file = chill, no notes. π)
empty lines and lines starting with # are ignored.
+VAR=VALUEβ environment. if the line starts with a plus (+), and the string following the plus contains a=,ipsvd(7)puts the string following the plus into the environment before startingprogto handle the connection. if the string following the plus doesn't contain a=,ipsvd(7)makes sure that the environment variable with the name string is not set.Cnum[:msg]β concurrency. if the line starts with aC, and is followed by a number, the per host concurrency limit for the IP address that initiated the connection is set to this number. if num is zero, the per host concurrency limit is disabled. if num is followed by:msg, the message msg is written to this client if possible, if the per host concurrency limit is reached.
msg may contain backslash-escaped characters as follows: \\ is converted to a single backslash, \n is converted to a new line character, and \r is converted to a carriage return.
on multiple concurrency instructions, the last processed concurrency instruction is considered. not all ipsvd(7)'s support per host concurrency. π
=hostname[:forward]β check hostname. if the line starts with a=, and is followed by a hostname,ipsvd(7)looks up the IP addresses for hostname in DNS and checks if the client's IP address matches one of these IP addresses. if so,ipsvd(7)stops processing the instructions here and runsprog. if hostname is followed by a colon and forward,ipsvd(7)now examines the file forward and acts accordingly, instead of runningprog. all check hostname instructions in forward are ignored. if forward does not exist, the connection is closed.
hostname may be 0 (zero), matching any IP address.
β οΈ note: using check hostname instructions can cause significant delay while responding to connection attempts, caused by DNS lookups. bestie, that's a real wait. π
if ipsvd(7) cannot interpret a line, it prints a warning, discards the line, and continues with the next instruction if any. (graceful. we love to see it. π
)
after processing all instructions, ipsvd(7) runs prog. but if the file contains at least one check hostname instruction, and none was successful, it closes the connection instead of running prog.
π EXAMPLE INSTRUCTIONS π
+MEMORY=20000β this instruction causes the environment variableMEMORYwith the value20000to be available to the programprogthat handles the connection.+DEBUG=β this instruction adds the variableDEBUGwith an empty value to the environment.+LOGNAMEβ this instruction makes sure that the environment variableLOGNAMEis unset when runningprog.C16β set the per host concurrency to 16. a connection will be closed silently if there are already 16 active connections from this client's IP address.=floyd.dyn.smarden.org:127.0.0.1β check IP address of the dynamic hostnamefloyd.dyn.smarden.org. if one of the IP addressesfloyd.dyn.smarden.orgcurrently resolves to matches the client's IP address, handle the connection through the file127.0.0.1in the instructions directory.
π«Ά SEE ALSO π«Ά
ipsvd(7), ipsvd-cdb(8), tcpsvd(8), sslsvd(8), udpsvd(8), sslio(8)
β AUTHOR β
Gerrit Pape <pape@smarden.org>
and that's the whole page, bestie β straight out of the ipsvd-instruct(5) manual page in the File Formats Manual, no details dropped, all facts intact, only the vibes were upgraded. πβ¨ slay responsibly, and go read your instructions directory like the main character you are. ππ¦π
π¦ 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