S6-RC-INIT(8)

πŸ“¦ version 0.7.0.0, in nixpkgs unstable

πŸ’… 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 the s6-rc(8) binary. no exceptions, no "oops I forgot" πŸ’€
  • bootdb (only if the -d option hasn't been given, iykyk), live and scandir must 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 on scandir

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-init creates will actually be called live:initial, and live will be a symbolic link to that directory. users should ignore this and always refer to the live directory as live in their future s6-rc(8) or s6-rc-update(8) invocations. the reason for this behaviour is that s6-rc-update(8) creates another, similarly named directory (live:suffix) and updates the live state by atomically changing the target of the live symlink β€” so live will 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 bootdb be a symbolic link to the database currently in use. this makes it way easier to create new compiled databases and switch them with s6-rc-update(8) without having to change the s6-rc-init invocation in boot scripts. future you will be so grateful 😭
  • after s6-rc-init runs, bootdb has 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 to s6-rc-update(8). like, do not touch it. for real. πŸ™ˆ

⭐ OPTIONS ⭐

  • -t timeout β€” if all s6-supervise(8) processes are not up and running after timeout milliseconds, s6-rc-init will complain and exit 111. 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 πŸ’€
  • -c bootdb β€” 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 invokes s6-rc-init πŸŽ€
  • -l live β€” store the live state into the live directory, which should not exist prior to running s6-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=live option to ./configure ✨
  • -p prefix β€” when linking all the service directories into scandir, prepend the symbolic link names with prefix, i.e. a longrun named A will have its service directory accessible via scandir/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 by s6-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-init will wait until that other program has released its lock on the database, then proceed. by default, s6-rc-init fails with an error message if the database is currently in use. so -b is 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-init invocation means it's possible to boot on a compiled service database whose validity has not previously been guaranteed by a successful s6-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