S6-RC-INIT(8)
π s6-rc-init π
okay so this is s6-rc-init, straight out of section 8 of the System Manager's Manual, and it's literally the glow-up your s6-rc system needs at boot π
β¨ NAME β¨
s6-rc-init β the initialization tool for the s6-rc system. that's the whole vibe. it sets things up so everything else can slay later π
πΈ SYNOPSIS πΈ
s6-rc-init [-c bootdb] [-l live] [-p prefix] [-t timeout] [-b] [-d]
scandir
π¦ DESCRIPTION π¦
so s6-rc-init is the initialization tool for the s6-rc system, and bestie, it has rules:
- It must be run as
root, at boot time, before any invocation of thes6-rc(8)binary. no exceptions, no "oops I forgot" π bootdb(only if the-doption hasn't been given, iykyk),liveandscandirmust all be absolute paths. periodt.
Here's what it expects to find, like a little checklist π:
- a compiled service database in
bootdb - the ability to create a directory named
live - an instance of
s6-svscan(8)running onscandir
then it does its thing: s6-rc-init initializes the live state in live, declares bootdb as the current service database, and sets the state as βall services downβ π₯
after that it copies verbatim all the service directories declared by bootdb into a subdirectory of live, adds ./down files to the live copies, and links those live copies into scandir. then it triggers s6-svscan(8), which will pick up the new service directories and start s6-supervise(8) processes on them β but the services themselves will not be started right away, because of those ./down files. sneaky but iconic π§
then s6-rc-init waits for all the s6-supervise(8) processes to be operational, and exits 0. slay π
π Typical usage π
admins should invoke s6-rc-init once, in their early boot scripts β after s6-svscan(8) is functional and ready to supervise longrun services (and after its catch-all logger, if any, has started), but before any other initialization. the rest of the initialization can be written as a set of s6-rc services and performed by just one invocation of the s6-rc change command, which is honestly so clean β¨
for instance, when you're using an init created by s6-linux-init, s6-rc-init should be the first command in the stage2 script (by default /etc/rc.init). first in line, main character energy fr fr π
π Notes π
- the directory that
s6-rc-initcreates will actually be calledlive:initial, andlivewill be a symbolic link to that directory. users should ignore this and always refer to the live directory aslivein their futures6-rc(8)ors6-rc-update(8)invocations. the reason for this behaviour is thats6-rc-update(8)creates another, similarly named directory (live:suffix) and updates the live state by atomically changing the target of thelivesymlink β solivewill not change names, whereas the real directory may. love a stable alias, ngl π«Ά - similarly, it's recommended that admins store their compiled service databases in some versioned directory, and that
bootdbbe a symbolic link to the database currently in use. this makes it way easier to create new compiled databases and switch them withs6-rc-update(8)without having to change thes6-rc-initinvocation in boot scripts. future you will be so grateful π - after
s6-rc-initruns,bootdbhas become the βlive compiled databaseβ and must not be tampered with or deleted. the only way to free it for deletion is to replace it with another database, via a call tos6-rc-update(8). like, do not touch it. for real. π
β OPTIONS β
-ttimeout β if alls6-supervise(8)processes are not up and running after timeout milliseconds,s6-rc-initwill complain and exit111. it's a safety feature so it doesn't hang indefinitely on a nonworking installation β normally this initialization shouldn't take more than a few milliseconds, so if it's taking a while something's sus π-cbootdb β declare bootdb as the current compiled service database for the upcoming live state. default is/etc/s6-rc/compiled/current. note that bootdb should always be a symlink pointing to the real compiled database: that's how databases can be live switched without modifying the boot process that invokess6-rc-initπ-llive β store the live state into the live directory, which should not exist prior to runnings6-rc-init, but should be under a writable filesystem β likely a RAM filesystem. default is/run/s6-rc. the default can be changed at compile time by giving the--livedir=liveoption to./configureβ¨-pprefix β when linking all the service directories into scandir, prepend the symbolic link names with prefix, i.e. a longrun namedAwill have its service directory accessible viascandir/prefixA. this lets several live directories be used with a unique scandir without risking conflicts between longruns with the same name from different service databases. honestly this option is only useful if you intend to have several sets of services independently managed bys6-rc(8), with different live directories, all using the same scandir to supervise their longruns. the default is no prefix at all, which is the move when you only have one live directory πΈ-bβ blocking lock. if the database is currently being used by another program,s6-rc-initwill wait until that other program has released its lock on the database, then proceed. by default,s6-rc-initfails with an error message if the database is currently in use. so-bis the "wait for itβ¦ wait for itβ¦" option π¦-dβ dereference bootdb. fully resolve the bootdb path before declaring it as the current compiled service database for the upcoming live state. using this flag in your init scripts's6-rc-initinvocation means it's possible to boot on a compiled service database whose validity has not previously been guaranteed by a successfuls6-rc-update(8)invocation: you should know what you are doing. like, for real for real, know what you're doing π
π SEE ALSO π
s6-rc-faq(7), s6-rc-overview(7), s6-rc-why(7), s6-rc(8), s6-rc-bundle(8), s6-rc-compile(8), s6-rc-db(8), s6-rc-dryrun(8), s6-rc-fdholder-filler(8), s6-rc-format-upgrade(8), s6-rc-oneshot-run(8), s6-rc-update(8)
this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-rc/s6-rc-init.html π
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
π«Ά that's the whole page, bestie. go forth and init responsibly.
and yeah, this one's from the Debian crew, dated October 30, 2025 β shoutout to the source and version for keeping it iconic, mwah π
π¦ where this page comes from
- nixpkgs unstable: s6-rc 0.7.0.0
- nixpkgs unstable: s6-rc-man-pages 0.6.0.0.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms