OpenRC


On Unix-like systems, OpenRC is a dependency-based init system. It received some notoriety as an alternative init system as distributions switched to systemd. It was created by Roy Marples, a NetBSD developer who was also active in the Gentoo project.
OpenRC is the default init system of Gentoo, Alpine Linux, Hyperbola GNU/Linux-libre, Parabola GNU/Linux-libre, Artix Linux, Maemo Leste, TrueOS and other unix-like systems, while some others such as Devuan offer it as an option. That means that the software packages and daemons of those systems/distributions support it, coming with or using the available scripts.

Design

OpenRC is made up of several modular components, the main ones being an init, the core dependency management system and a daemon supervisor. It is written in C and POSIX compliant shell making it usable on BSD and Linux systems.
The core part of OpenRC handles dependency management and init script parsing. OpenRC works by scanning the runlevels, building a dependency graph, then starting the needed service scripts. It exits once the scripts have been started. By default, OpenRC uses a modified version of start-stop-daemon for daemon management.
Init scripts share similarities with scripts used in SysVinit, but offer several features to simplify their creation. Scripts are assumed to have start, stop and status and the system uses variables already declared to create the default functions. The depend function is used to declare dependencies to other services that would be done with LSB headers in SysVinit. Configuration and mechanism are separated with configuration files in the conf.d directory and init files in the init.d directory.
Openrc-init first appeared in version 0.25 as an optional replacement for /sbin/init. Several other inits are supported including SysVinit and Busybox.
Supervise-daemon first appeared in version 0.21 giving openrc supervision capabilities. It can be enabled in the init script for supervise-daemon to start and monitor a daemon. Several other daemon supervisors are supported including runit and s6.

Features