This article needs additional citations for verification. (July 2019) (Learn how and when to remove this template message)
|Original author(s)||Roy Marples|
|Initial release||5 April 2007|
0.42.1 / 20 August 2019
|Written in||C, Shell|
|Operating system||Linux, FreeBSD, NetBSD, TrueOS|
|License||2-clause BSD license|
OpenRC is a dependency-based init system for Unix-like computer operating systems. It was created by Roy Marples, a NetBSD developer who was also active in the Gentoo project. It became more broadly adopted as an init system outside of Gentoo following the decision by some Linux distributions not to adopt systemd.
OpenRC is the default init system of Gentoo, Alpine Linux, Hyperbola GNU/Linux-libre, Parabola GNU/Linux-libre, Artix Linux, Maemo Leste, TrueOS, Funtoo 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.
OpenRC is made up of several modular components, the main ones being an init (optional), the core dependency management system and a daemon supervisor (optional). 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
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.
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.
- Portable between Linux, FreeBSD, and NetBSD
- Parallel service startup (off by default)
- Dependency-based boot-up
- Process segregation through cgroups
- Per-service resource limits (ulimit)
- Separation of code and configuration (init.d / conf.d)
- Extensible startup scripts
- Stateful init scripts (is it started already?)
- Complex init scripts to start multiple components (Samba [smbd and nmbd], NFS [nfsd, portmap, etc.])
- Automatic dependency calculation and service ordering
- Modular architecture and separation of optional components (cron, syslog)
- Expressive and flexible network handling (including VPN, bridges, etc.)
- Verbose debug mode
- "openrc-0.42.1". Retrieved September 19, 2019.
- "openrc", Analysis Summary, Ohloh, retrieved 2012-03-10
- "History". Retrieved 6 April 2020.
- "Developers". Retrieved 6 April 2020.
- "Manjaro OpenRC 0.8.13 - reinventing init without systemd". DistroWatch Weekly, Issue 612. 1 June 2015. Retrieved 2020-04-04.
- "5 Differences Between TrueOS & Linux". Retrieved 6 April 2020.
- "Improving TrueOS: OpenRC". Retrieved 6 April 2020.
- "4. Post Installation Configuration — TrueOS® User Guide". www.trueos.org. Retrieved 2017-03-12.
- "Devuan ASCII 2.0.0 stable release". Retrieved 2021-01-18.
- "user guide". Retrieved 6 April 2020.
- "service script guide". Retrieved 6 April 2020.
- "runit guide". Retrieved 6 April 2020.
- "s6 Guide". Retrieved 6 April 2020.
- "CGroups Support". Retrieved 5 April 2020.