OpenRC

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
OpenRC
Original author(s)Roy Marples
Developer(s)OpenRC Developers
Initial release5 April 2007; 13 years ago (2007-04-05)
Stable release
0.42.1 / 20 August 2019; 13 months ago (2019-08-20)[1]
Repository Edit this at Wikidata
Written inC[2], Shell
Operating systemLinux, FreeBSD, NetBSD, TrueOS
Size~900 KB
TypeInit daemon
License2-clause BSD license
Websitewww.gentoo.org/proj/en/base/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.[3][4][5] It was created by Roy Marples, a NetBSD developer who was also active in the Gentoo project.[6][7]

OpenRC is the default init system of Gentoo, Alpine Linux, Hyperbola GNU/Linux-libre, Parabola GNU/Linux-libre, Artix Linux, Maemo Leste, TrueOS[8] and other unix-like systems, while some others such as Devuan offer it as an option.[9] That means that the software packages and daemons of those systems/distributions support it, coming with or using the available scripts.

Design[edit]

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.[10]

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.[11] 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[12].

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[13] and s6[14].

Features[edit]

  • Portable between Linux, TrueOS, FreeBSD, and NetBSD
  • Parallel service startup (Off by default)
  • Dependency based boot-up
  • Process segregation through cgroups[15]
  • 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

References[edit]

  1. ^ "openrc-0.42.1". Retrieved September 19, 2019.
  2. ^ "openrc", Analysis Summary, Ohloh, retrieved 2012-03-10
  3. ^ "DistroWatch.com: Put the fun back into computing. Use Linux, BSD". distrowatch.com. Retrieved 2020-04-04.
  4. ^ "5 Differences Between TrueOS & Linux". Retrieved 6 April 2020.
  5. ^ "Improving TrueOS: OpenRC". Retrieved 6 April 2020.
  6. ^ "History". Retrieved 6 April 2020.
  7. ^ "Developers". Retrieved 6 April 2020.
  8. ^ "4. Post Installation Configuration — TrueOS® User Guide". www.trueos.org. Retrieved 2017-03-12.
  9. ^ "Devuan ASCII 2.0.0 stable release". Retrieved 2018-07-17.
  10. ^ "user guide". Retrieved 6 April 2020.
  11. ^ "service script guide". Retrieved 6 April 2020.
  12. ^ OpenRC
  13. ^ "runit guide". Retrieved 6 April 2020.
  14. ^ "s6 Guide". Retrieved 6 April 2020.
  15. ^ "CGroups Support". Retrieved 5 April 2020.

External links[edit]