|
1 | 1 | Finit Features |
2 | 2 | ============== |
3 | 3 |
|
| 4 | +This page highlights some of Finit's key features with examples and usage |
| 5 | +scenarios. For complete documentation, configuration syntax, and advanced |
| 6 | +options, see the [Configuration](config/index.md) section. |
| 7 | + |
4 | 8 | **Process Supervision** |
5 | 9 |
|
6 | 10 | Start, monitor and restart services should they fail. |
@@ -162,6 +166,28 @@ See the [Linux Capabilities](config/capabilities.md) section for detailed |
162 | 166 | information, examples, and security best practices. |
163 | 167 |
|
164 | 168 |
|
| 169 | +**Supplementary Groups** |
| 170 | + |
| 171 | +Finit supports supplementary groups for services, allowing them to access |
| 172 | +resources owned by multiple groups without running as root. This complements |
| 173 | +capabilities for fine-grained privilege control. |
| 174 | + |
| 175 | +```conf |
| 176 | +service @caddy:caddy,ssl-cert /usr/bin/caddy run |
| 177 | +``` |
| 178 | + |
| 179 | +In this example, the Caddy web server runs as user `caddy` with primary group |
| 180 | +`caddy`, but also has access to resources owned by the `ssl-cert` group (such |
| 181 | +as TLS certificates). |
| 182 | + |
| 183 | +Finit automatically reads the user's supplementary group membership from |
| 184 | +`/etc/group`. Additional groups can be specified explicitly using the syntax |
| 185 | +`@user:group,sup1,sup2,...`. |
| 186 | + |
| 187 | +See the [Non-privileged Services](config/services.md#non-privileged-services) |
| 188 | +section for more information. |
| 189 | + |
| 190 | + |
165 | 191 | **Cgroups** |
166 | 192 |
|
167 | 193 | Finit supports cgroups v2 and comes with the following default groups in |
@@ -207,4 +233,59 @@ commands for details. |
207 | 233 | > disabled early at boot. |
208 | 234 |
|
209 | 235 |
|
| 236 | +**Service Management** |
| 237 | + |
| 238 | +Finit includes the `initctl` tool for managing services and system state at |
| 239 | +runtime. Key capabilities include: |
| 240 | + |
| 241 | +- **Enable/Disable services**: Manage which services start at boot by moving |
| 242 | + configuration files between `/etc/finit.d/available` and |
| 243 | + `/etc/finit.d/enabled` |
| 244 | +- **Start/Stop/Restart**: Control individual services without requiring a |
| 245 | + full system reboot |
| 246 | +- **Status monitoring**: View service state, PID, uptime, and resource usage |
| 247 | +- **Condition management**: Set and clear user-defined conditions to control |
| 248 | + service dependencies |
| 249 | +- **Cgroup monitoring**: Real-time process and resource monitoring with |
| 250 | + `initctl top`, similar to the traditional `top` command but cgroup-aware |
| 251 | + |
| 252 | +Example commands: |
| 253 | + |
| 254 | +```bash |
| 255 | +initctl enable myservice # Enable service for next boot |
| 256 | +initctl start myservice # Start service now |
| 257 | +initctl status # Show all services |
| 258 | +initctl top # Interactive resource monitor |
| 259 | +initctl cond set usr/custom # Set custom condition |
| 260 | +``` |
| 261 | + |
| 262 | +See the [Commands & Status](initctl.md) section for complete documentation. |
| 263 | + |
| 264 | + |
| 265 | +**Rescue Mode** |
| 266 | + |
| 267 | +Finit provides a built-in rescue mode for system recovery and maintenance. |
| 268 | +When booting with the `rescue` kernel parameter, the system enters a |
| 269 | +protected maintenance shell. |
| 270 | + |
| 271 | +If the bundled `sulogin` program is available (from Finit, util-linux, or |
| 272 | +BusyBox), you'll be prompted for the root password before accessing the |
| 273 | +maintenance shell. This provides secure access for system recovery. |
| 274 | + |
| 275 | +If `sulogin` is not available, Finit falls back to reading |
| 276 | +`/lib/finit/rescue.conf` and boots the system in a limited maintenance mode. |
| 277 | + |
| 278 | +``` |
| 279 | +# Kernel command line |
| 280 | +linux /vmlinuz root=/dev/sda1 rescue |
| 281 | +``` |
| 282 | + |
| 283 | +In rescue mode, `initctl` will not work. After fixing the problem, use |
| 284 | +`reboot -f` to force reboot. |
| 285 | + |
| 286 | +Rescue mode can be disabled at build time with `configure --without-rescue`. |
| 287 | + |
| 288 | +See the [Rescue Mode](config/rescue.md) section for more information. |
| 289 | + |
| 290 | + |
210 | 291 | [5]: https://en.wikipedia.org/wiki/Runlevel |
0 commit comments