Aaron Andersen points out in the #492 discussion that the *Directory settings carry more contract than create-and-chown: per-directory modes, specific ownership rules, and cleanup toggles. Without them config-dir was chowned to the service user, which systemd never does, an existing directory with drifted ownership was left wrong, and the runtime directory could not survive a restart. Now matching systemd.exec(5), and where the man page is vague, the code in setup_exec_directory(): - each directory takes a matching -mode key, octal with the leading zero, default 0755. The mode of the named directory is locked down again on every start, also when it already exists - config-dir is created but never chowned - the contents of an existing directory are left alone as long as the owner is right; on drift everything under it is chowned back - runtime-dir-preserve = no | restart | yes maps RuntimeDirectoryPreserve=. A service still qualified to run when the runtime directory would be removed is restarting, not stopping, which is what svc_enabled() answers The dir mechanics move to mksubsysd(), taking resolved ids, with mksubsys() reduced to a name-resolving wrapper for the dbus plugin. The child resolves uid/gid once for both directory setup and privilege drop. The symlink form, RuntimeDirectory=foo:bar, is not adopted. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Introduction
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.localsupport - Process supervision similar to systemd
- Fine-grained privilege control:
- Linux capabilities for minimal required privileges
- Supplementary groups for multi-group resource access
- 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
- Automatic reload of modified configuration files (optional)
- 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
suloginfor protected maintenance shell - Switch root support for initramfs-to-real-root transitions
- Integration with watchdogd for full system supervision
- Logging to kernel ring buffer before
syslogdhas started, see the recommended sysklogd project for complete logging integration and how to log to the kernel ring buffer from scripts usinglogger
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.
