S6-ACCESSRULES-CDB-FROM-FS(8)
π s6-accessrules-cdb-from-fs(8) β bestie, weβre compiling a ruleset directory into a CDB file β¨
πΈ NAME πΈ
<pink>s6-accessrules-cdb-from-fs</pink> β okay so this icon compiles a directory containing a ruleset suitable for s6-ipcserver-access(8) or s6-tcpserver-access(8) into a CDB[1] file. Literally thatβs the whole gig. π«Ά
β¨ SYNOPSIS β¨
s6-accessrules-cdb-from-fs [-m mode] cdbfile dir
π DESCRIPTION π
s6-accessrules-cdb-from-fs compiles the dir directory containing a ruleset into a CDB[1] file cdbfile then exits 0. No cap, thatβs it. π
ποΈ Ruleset directory format ποΈ
For s6-accessrules-cdb-from-fs, s6-ipcserver-access(8), or s6-tcpserver-access(8) to understand it, dir must have a specific format. Bestie, this is not a free-for-all. π
dir contains a series of directories:
ip4β rules on IPv4 addresses. πip6β rules on IPv6 addresses. π°οΈreversednsβ rules on host names. π·οΈuidβ rules on user IDs. π€gidβ rules on group IDs. π₯
Depending on the application, other directories can appear in dir and be compiled into cdbfile, but s6-tcpserver-access(8) only uses the first three, and s6-ipcserver-access(8) only uses the last two. So yeah, context matters. π
Each of those directories contains a set of rules. A rule is a subdirectory named after the set of keys it matches, and containing actions that will be executed if the rule is the first matching rule for the tested key. First match wins, periodt. π
The syntax for the rule name is dependent on the nature of keys, and fully documented in s6-accessrules(7). For instance, a subdirectory named 192.168.0.0_27 in the ip4 directory will match every IPv4 address in the 192.168.0.0/27 network that does not match a more precise rule. Iconic little network moment. π
The syntax for the actions, however, is the same for every type of key. A rule subdirectory can contain the following elements:
- A file (that can be empty) named
allow. If such a file exists, a key matching this rule will be immediately accepted. β - A file (that can be empty) named
deny. If such a file exists and noallowfile exists, a key matching this rule will be immediately denied. π« - A subdirectory named
env. If such a directory exists along with anallowfile, then its contents represent environment modifications that will be applied after accepting the connection and before executing the next program in the chain, as if thes6-envdir(8)program, without options, was applied toenv.envhas exactly the same format as a directory suitable fors6-envdir(8); however, if the modifications take up more than4096bytes when compiled intocdbfile, thens6-accessrules-cdb-from-fswill complain and exit100. β οΈ - A file named
exec. If such a file exists along with anallowfile, then its contents represent a command line that, interpreted by theexeclineb(1)launcher, will be executed after accepting the connection, totally bypassing the original command line.s6-accessrules-cdb-from-fstruncates theexecfile to4096bytes max when embedding it intocdbfile, so make sure it is not larger than that. πββοΈπ¨
cdbfile can exist prior to, and during, the compilation, which actually works in a temporary file in the same directory as cdbfile and performs an atomic replacement when it is done. So it is not necessary to interrupt a running service during the compilation. Slay, zero-downtime vibes. β¨
If s6-accessrules-cdb-from-fs fails at some point, the temporary file is removed. However, this doesnβt happen if s6-accessrules-cdb-from-fs is interrupted by a signal. π Important caveat, bestie.
After the program successfully completes, if dir was a suitable candidate for the -i option of s6-ipcserver-access(8) or s6-tcpserver-access(8), then cdbfile will be a suitable candidate for the -x option of the same program, implementing the same ruleset. Full circle. π«Ά
cdbfile can be decompiled by the s6-accessrules-fs-from-cdb(8) program. Cute. π
π OPTIONS π
-m modeβ Createcdbfilewith permissionsmode(an octal number). π
π₯ SEE ALSO π₯
execlineb(1), s6-accessrules-fs-from-cdb(8), s6-connlimit(8), s6-ioconnect(8), s6-ipcclient(8), s6-ipcserver(8), s6-ipcserver-access(8), s6-ipcserver-socketbinder(8), s6-ipcserverd(8), s6-tcpserver-access(8)
[1] https://en.wikipedia.org/wiki/Cdb_(software)
This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-accessrules-cdb-from-fs.html
π AUTHORS π
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)
πΈπ Thatβs the page, bestie β source/version: Debian, date: October 4, 2025, manual: S6-ACCESSRULES-CDB-FROM-FS(8), System Manager's Manual. Stay iconic and may your rulesets always be first-match correct. π
β¨
π¦ where this page comes from
- nixpkgs unstable: s6 2.15.1.0
- nixpkgs unstable: s6-man-pages 2.14.0.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms