mirror of
https://github.com/troglobit/finit.git
synced 2026-11-02 13:20:32 +00:00
doc: fix back-references and stale claims left by the conversion
Reference sections kept pointing at the line-based format they no longer
document. `sysv` and `task` sent the reader to Services for "<COND>",
the cgroups chapter opened by listing three legacy directives and then
explained further down that only two of them exist here, and the logging
chapter still gave "log:prio:facility.level,tag:ident" as the full
syntax.
Some claims were wrong independent of the format:
- a sysv is a supervised daemon, grouped with service in
SVC_TYPE_DAEMON, not a variation on task
- restart-max has no upper bound of 255, or any other
- the built-in rescue fallback runs in 12345789, not 12345
- conditional loading quotes system/10-hotplug.conf, not
system/hotplug.conf
- the key spells conflicts, not conflict
- the built-in getty no longer wants TERM last, it is a key
`if` takes either a service name or, in angle brackets, a condition,
decided in svc_ifthen(). Only the examples showed this, so it is now
said.
Terminology follows the split index.md already draws: a block is the new
format, a stanza the line-based one.
src/rescue.conf was still line-based, missed because it sits in src/
rather than system/ or contrib/.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
21 files changed
+190
-170
No files matched your search
+17
-19
@@ -1,19 +1,17 @@
|
||||
Finit provides three different cgroup directives for controlling resource allocation:
|
||||
Finit has two `cgroup` blocks for controlling resource allocation:
|
||||
|
||||
1. **Top-level cgroup definition**: `cgroup NAME settings`
|
||||
- Defines a top-level cgroup (e.g., `init`, `system`, `user`) with default settings
|
||||
- Space-separated syntax
|
||||
- Example: `cgroup system cpu.weight:9700`
|
||||
1. **Top-level definition**, at file scope: declares a group such as
|
||||
`init`, `system`, or `user`, and its default settings.
|
||||
|
||||
2. **Global cgroup selector**: `cgroup.NAME[,options]` (standalone directive)
|
||||
- Sets the default cgroup for subsequent services in a `.conf` file
|
||||
- Dot-separated with optional comma-separated options
|
||||
- Example: `cgroup.maint` or `cgroup.system,delegate`
|
||||
cgroup system { cpu.weight = 9700 }
|
||||
|
||||
3. **Per-service cgroup option**: `cgroup.NAME[,options]` or `cgroup:options`
|
||||
- Overrides the cgroup for a specific service
|
||||
- Part of the service directive line
|
||||
- Example: `service [...] cgroup.maint,mem.max:1G /path/to/cmd`
|
||||
2. **Joining a group**, inside a service block: names the group this
|
||||
service runs in, and may override settings for itself alone.
|
||||
|
||||
service foo {
|
||||
cgroup maint { memory.max = 1G }
|
||||
command = "/path/to/cmd"
|
||||
}
|
||||
|
||||
> [!NOTE]
|
||||
> Linux cgroups and details surrounding values are not explained in the
|
||||
@@ -84,11 +82,11 @@ apply to that service alone:
|
||||
> joins a group says so itself, so the group cannot depend on what came
|
||||
> earlier in the file.
|
||||
|
||||
Note the `mem.` exception to the rule: every cgroup setting maps directly to
|
||||
cgroup v2 syntax. I.e., `cpu.max` maps to the file `/sys/fs/cgroup/maint/foo/cpu.max`.
|
||||
There is no filtering, except for expanding the shorthand `mem.` to `memory.`.
|
||||
If the file is not available, either the cgroup controller is not available
|
||||
in your Linux kernel, or the name is misspelled.
|
||||
Every cgroup setting maps directly to cgroup v2 syntax, so `cpu.max`
|
||||
maps to the file `/sys/fs/cgroup/maint/foo/cpu.max`. There is no
|
||||
filtering, the one exception being the shorthand `mem.`, which expands
|
||||
to `memory.`. If the file is not available, either the controller is
|
||||
missing from your Linux kernel, or the name is misspelled.
|
||||
|
||||
### Overriding Cgroup Leaf Names
|
||||
|
||||
@@ -229,7 +227,7 @@ Initially, the service process runs directly in the cgroup root:
|
||||
|
||||
Once the container runtime creates child cgroups (e.g., `libpod-*/`), cgroups v2
|
||||
enforces the "no internal processes" rule. When Finit detects this (`EBUSY` error),
|
||||
it automatically creates an `supervisor/` subdirectory and moves service-related
|
||||
it automatically creates a `supervisor/` subdirectory and moves service-related
|
||||
processes there:
|
||||
|
||||
/sys/fs/cgroup/system/container@web/
|
||||
|
||||
Reference in new issue
Block a user