Software:OpenRC
Original author(s) | Roy Marples |
---|---|
Developer(s) | OpenRC Developers |
Initial release | 5 April 2007 |
Written in | C,[1] Shell |
Operating system | Linux, FreeBSD, NetBSD |
Size | ~1550 KB |
Type | Init daemon |
License | 2-clause BSD license |
Website | wiki |
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.[2][3] It became more broadly adopted as an init system outside of Gentoo following the decision by some Linux distributions not to adopt systemd.[4][5][6]
File:Gentoo-grub-openrc-booting--thinkpad-t430.webm
Adoption
OpenRC is the default init system and/or process supervisor for:
- Alpine Linux
- Funtoo
- Gentoo Linux
- Hyperbola GNU/Linux-libre
- Maemo Leste
- Nitrux
OpenRC is an available init system and/or process supervisor for:
- Artix Linux (some consider it the default[7])
- Devuan[8]
- Parabola GNU/Linux-libre
Design
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.[9]
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.[10] 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
. This can replace Gentoo Linux's default init system, sysvinit.[11]
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[12] and s6.[13]
Features
- Portable between Linux, FreeBSD, and NetBSD
- Parallel service startup (off by default)
- Dependency-based boot-up
- Process segregation through cgroups[14]
- Per-service resource limits (ulimit)
- Separation of code and configuration (init.d / conf.d)
- Extensible startup scripts
- Stateful init scripts (has 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
References
- ↑ "openrc", Analysis Summary (Ohloh), http://www.ohloh.net/p/openrc, retrieved 2012-03-10
- ↑ "History". https://github.com/OpenRC/openrc/blob/master/HISTORY.md.
- ↑ "Developers". https://www.netbsd.org/people/developers.html.
- ↑ "Manjaro OpenRC 0.8.13 - reinventing init without systemd". DistroWatch Weekly, Issue 612. 1 June 2015. https://distrowatch.com/weekly.php?issue=20150601.
- ↑ "5 Differences Between TrueOS & Linux". 23 February 2018. https://www.kompulsa.com/2018/02/23/5-differences-trueos-linux/.
- ↑ "Improving TrueOS: OpenRC". https://www.trueos.org/blog/improving-trueos-openrc/.
- ↑ "Distro's forum - Which init system is Artix's default?" (in en). https://forum.artixlinux.org/index.php/topic,1769.0.html.
- ↑ "Devuan ASCII 2.0.0 stable release" (in en). https://www.devuan.org/os/announce/ascii-stable-announce-060818.
- ↑ "user guide". https://github.com/OpenRC/openrc/blob/master/user-guide.md#start-stop-daemon.
- ↑ "service script guide". https://github.com/OpenRC/openrc/blob/master/service-script-guide.md#the-default-functions.
- ↑ "OpenRC/openrc-init". February 6, 2023. https://wiki.gentoo.org/wiki/OpenRC/openrc-init. Retrieved October 7, 2023.
- ↑ "runit guide". https://github.com/OpenRC/openrc/blob/master/runit-guide.md.
- ↑ "s6 Guide". https://github.com/OpenRC/openrc/blob/master/s6-guide.md.
- ↑ "CGroups Support". https://wiki.gentoo.org/wiki/OpenRC#CGroups_support.
Original source: https://en.wikipedia.org/wiki/OpenRC.
Read more |