After about three years of development, the release of the Finit 4.0 (Fast init) initialization system has been published, developed as a simple alternative to SysV init and systemd. The project is based on work created through reverse engineering the fastinit initialization system used in the Linux firmware of EeePC netbooks, notable for its very fast boot process. The system is primarily aimed at ensuring the booting of compact and embedded systems, but can also be applied to regular desktop and server environments. Implementation scenarios have been prepared for Void Linux, Alpine Linux, and Debian GNU/Linux. The project's code is written in C and is distributed under the MIT license.
Finit supports SysV init-style runlevels, tracks the health of background processes (automatically restarting services in the event of failure), executes one-off handlers, launches services considering dependencies and arbitrary conditions, and attaches additional handlers to run before or after executing a service. For example, a service can be configured to start only after network access is available or after another service, such as syslogd, has been started. Cgroups v2 is used for applying constraints.
To extend functionality and tailor it to their needs, plugins can be used, for which a hook system is provided, allowing the attachment of handlers to various stages of service loading and execution, as well as binding to external events. For example, plugins have been prepared to support D-Bus, ALSA, netlink, resolvconf, hotplugging devices, checking availability and loading kernel modules, handling PID files, and configuring the environment for the X server.
The use of standard service startup scripts created for SysV init is supported (/etc/rc.d and /etc/init.d are not used, but support for /etc/inittab can be implemented via a plugin), as well as rc.local scripts, files with environment variables, and network settings in /etc/network/interfaces, similar to Debian and BusyBox. Settings can either be defined in a single configuration file /etc/finit.conf or distributed across multiple files in the /etc/finit.d directory.
Management is carried out through the standard tools initctl and run-parts, allowing for the activation and deactivation of services linked to runlevels, as well as selectively starting certain services. Finit also includes a built-in implementation of getty (terminal management and user login), a watchdog for monitoring functionality, and a recovery mode after failure with an embedded sulogin to launch an isolated command shell.

Among the changes added in the Finit 4.0 release (version 3.2 was skipped due to the presence of changes that break backward compatibility):
- The standalone reboot utility has been replaced with a symbolic link to initctl, similar to the halt, shutdown, poweroff, and suspend utilities.
- Progress indication for operations has been implemented.
- The operation of the commands "initctl cond set|clear COND" has been modified to link actions to various events. The syntax is now used to identify services instead of linking to paths .
- The built-in implementation has been removed. server inetd, in which xinetd can be installed if needed.
- Support for cgroups v2 has been added for launching services in separate cgroups.
- A recovery mode after failure has been added with its own sulogin.
- Support for SysV init start/stop scripts has been added.
- Pre:script and post:script handlers have been added, allowing you to specify your own actions performed before or when starting a service.
- Support for env:file with environment variables has been added.
- The ability to monitor arbitrary PID files has been added.
- The ability to start tasks and services using relative paths has been added.
- The option "-b" has been added to initctl for performing actions in non-interactive mode (batch mode).
- The built-in watchdog has been replaced with a separate watchdogd variant.
- A plugin has been added for automatically loading kernel modules for devices plugged in during operation.
- A plugin has been added to handle /etc/modules-load.d/.
- Support for automatic service restarts after configuration changes has been added, allowing you to avoid manually executing the command "initctl reload". It is disabled by default and requires rebuilding with "./configure --enable-auto-reload".
- The ability to maintain a log of operations that affect security, such as changing runlevel, starting and stopping services, and service failures, has been added.
- Improved support for /etc/network/interfaces.
Source: opennet.ru
