Files
finit/doc
Joachim Wiberg f4a13687e8 initctl: resolve hierarchical cgroup limits
Cgroups v2 limits are hierarchical - a process is constrained by the
most restrictive limit in its ancestor chain, not just its immediate
cgroup.  This patch updates cg_conf() to walk up the hierarchy and
report effective limits by comparing values at each level.

This fixes incorrect "max" (unlimited) reporting in 'initctl --json
status', 'initctl cgroup', and 'initctl top' when child cgroups have
no explicit limits but parents do.

For memory.max and cpu.max: take minimum (most restrictive)
For memory.min: take maximum (most protection)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-12-17 08:19:37 +01:00
..
2025-07-10 16:45:48 +02:00
2025-12-07 09:53:56 +01:00
2025-08-29 12:54:06 +02:00
2025-11-30 11:36:53 -05:00

Introduction

Alpine screenshot{ align=right }

Reverse engineered from the EeePC fastinit
"gaps filled with frog DNA …"
— Claudio Matsuoka

Finit is a process starter and supervisor designed to run as PID 1 on Linux systems. It consists of a set of plugins and can be set up using configuration files. Plugins start at hook points and can run various set up tasks and/or install event handlers that later provide runtime services, e.g., PID file monitoring, or conditions.

Features

  • Runlevels, defined per service
  • One-shot tasks, services (daemons), or SysV init start/stop scripts
  • Runparts and /etc/rc.local support
  • Process supervision similar to systemd
  • Sourcing environment files
  • Conditions for network/process/custom dependencies
  • Readiness notification; PID files (native) for synchronizing system startup, support for systemd sd_notify(), or s6 style too
  • Limited support for tmpfiles.d(5) (no aging, attributes, or subvolumes)
  • Pre/Post script actions
  • Rudimentary templating support
  • Tooling to enable/disable services
  • Built-in getty
  • Built-in watchdog, with support for hand-over to watchdogd
  • Built-in support for Debian/BusyBox /etc/network/interfaces
  • Cgroups v2, both configuration and monitoring in initctl top
  • Plugin support for customization
  • Proper rescue mode with bundled sulogin for protected maintenance shell
  • Integration with watchdogd for full system supervision
  • Logging to kernel ring buffer before syslogd has started, see the recommended sysklogd project for complete logging integration and how to log to the kernel ring buffer from scripts using logger

For a more thorough overview, see the Features section.

Tip

See SysV Init Compatibility for help to quickly get going with an existing SysV or BusyBox init setup.

Origin

This project is based on the original finit by Claudio Matsuoka which was reverse engineered from syscalls of the EeePC fastinit.

Finit is developed and maintained by Joachim Wiberg at GitHub. Please file bug reports, clone it, or send pull requests for bug fixes and proposed extensions.