66-init
(Basically this page is not yet fully furnished)
66 is a service management suite (also an "init system") which uses sys-apps/s6 under the hood.
It is a wrapper around the s6 supervision suite; See the draft document for more info.
It provides a simple declarative service frontend format, with support for (hard and soft) dependencies and other features like the user to run under, the description, grouping services by trees (similar to runlevels but more), etc... See the official documentation page for more detailed info.
Installation
66 suite is divided into various packages. All packages are available on the [66-svmgr repo].
Add it with
root #
eselect repository add 66-svmgr git https://github.com/pramodvu1502/66-svmgr-gentoo-overlay/
And sync with either
root #
emaint sync -r 66-svmgr
or
root #
emerge --sync 66-svmgr
.
Install package sys-apps/66-boot ; It will automatically pull the suite as a dependency, along with some important service definitions for booting.
root #
emerge --ask sys-apps/66-boot::66-svmgr
(KERNEL flags not applicable to this software)
Configuration
Run the command
root #
66 configure boot@system
(You can replace `system` with anything in `boot@system`); It will drop you into your ${EDITOR} where you can adjust many environment variables; Those variables affect how the boot process will be configured.
(Kindly note that currently `66` has many variables built-in like HOSTNAME which override and overwrite the global confs like /etc/hostname; This is being fixed soon to respect the global configuration; And to make those settings optional which isn't the case right now)
You may like to
root #
ln -s ../env.d /etc/66/environment
in order to get all the env-vars applied in 66 just as in openrc; The supported format is exactly the same across openrc and 66 (`VAR="value"` only, no commands or flags, or shell-specific substitutions).
Environment variables
Explained and listed in the 66 configure command itself
Files
- /usr/share/66/service - Packaged frontends for system services
- /usr/share/66/service/user - Packaged frontends for user services
- /etc/66/ - Same as /usr/share/66/ but for the system admin/user.
- /var/lib/66 - The underlying databases of results of the parsing of the frontends are stored here; Frontends are parsed and their results like start/stop scripts, dependency chains etc... are stored here; Kindly don't touch this manually.
- ~/.66/ - Same as /etc/66/ and /usr/share/66/ but for per-user.
- ~/.66/system - The per-user equivalent of /var/lib/66
- /etc/66/init.conf - Basic variables for 66. (Can be overriden by mentioning on the kernel command line the same KEY=value pairs as in the conffile)
Usage
This software is a service manager and an init system.
To use it for init, create an executable script with `#!/usr/bin/execlineb` as shebang and `66 boot` as the only command. And point the kernel to init that executable.
The only user-facing command is `66`. (Yes, a number)
Run
user $
66 -h
for help;
user $
66 ${subcommand} -h
for specific help.
Usage in service files
Many other tools are available, like 66-ns, execl-* commands, etc... which are meant to be used in service scripts.
A simple non-interactive scripting language execline is used in 66 (created by the developer of s6 himself). The entire script in that language is converted into a long command; each step i.e. command executes into the next. However, you are free to use your own interpreter by specifying a Build=custom key-value pair in the section with the custom-script and specifying the interpreter in the Execute=() key as Execute=(#!/bin/sh/or/some.other/interpreter with the script next line onwards until the ending ).
Note: 66 is capable of differentiating the ) in case $var in state) command ;; from the end of Execute=(; So don't worry about it, write your scripts normally.
(Sorry, the Note template isn't working.)
Caveats
Since this is new software, not all services and daemons have 66-compatible frontend files. You might have to install them unpackaged into /etc/66/service/ or in rare cases even write them manually. Kindly contact the writer of this wiki for help.
Some more caveats with paths in scripts, and the general working of 66, exist; They are not yet fully found.
Tips
Troubleshooting
Unmerge
root #
emerge --ask --depclean --verbose sys-apps/66-boot::66-svmgr
See also
- S6 — a package that provides a daemontools-inspired process supervision suite, a notification framework, a UNIX domain super-server, and tools for file descriptor holding and suidless privilege gain.