OpenRC

Last updated
OpenRC
Original author(s) Roy Marples
Developer(s) OpenRC Developers
Initial release5 April 2007;16 years ago (2007-04-05)
Stable release
0.53 [1] / 12 January 2024;2 months ago (12 January 2024)
Repository
Written in C, [2] Shell
Operating system Linux, FreeBSD, NetBSD
Size ~1550 KB
Type Init daemon
License 2-clause BSD license
Website wiki.gentoo.org/wiki/Project:OpenRC

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. [3] [4] It became more broadly adopted as an init system outside of Gentoo following the decision by some Linux distributions not to adopt systemd. [5] [6] [7]

Contents

OpenRC booting Artix Linux Openrc-artix.png
OpenRC booting Artix Linux
Booting process

Adoption

OpenRC is the default init system and/or process supervisor for:

OpenRC is an available init system and/or process supervisor for:

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. [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. This can replace Gentoo Linux's default init system, sysvinit. [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

Related Research Articles

<span class="mw-page-title-main">Gentoo Linux</span> Linux distribution

Gentoo Linux is a Linux distribution built using the Portage package management system. Unlike a binary software distribution, the source code is compiled locally according to the user's preferences and is often optimized for the specific type of computer. Precompiled binaries are available for some packages. Gentoo runs on a wide variety of processors, including x86, PowerPC, SPARC, DEC Alpha, ARM, MIPS and PA-RISC.

<span class="mw-page-title-main">GoboLinux</span> Linux distribution

GoboLinux is a Linux distribution whose most prominent feature is a reorganization of the traditional Linux file system. Rather than following the Filesystem Hierarchy Standard like most Unix-like systems, each program in a GoboLinux system has its own subdirectory tree, where all of its files may be found. Thus, a program "Foo" has all of its specific files and libraries in /Programs/Foo, under the corresponding version of this program at hand. For example, the commonly known GCC compiler suite version 8.1.0, would reside under the directory /Programs/GCC/8.1.0.

<span class="mw-page-title-main">Daemon (computing)</span> Computer program that runs as a background process

In multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user. Traditionally, the process names of a daemon end with the letter d, for clarification that the process is in fact a daemon, and for differentiation between a daemon and a normal computer program. For example, syslogd is a daemon that implements system logging facility, and sshd is a daemon that serves incoming SSH connections.

A runlevel is a mode of operation in the computer operating systems that implements Unix System V-style initialization. Conventionally, seven runlevels exist, numbered from zero to six. S is sometimes used as a synonym for one of the levels. Only one runlevel is executed on startup; run levels are not executed one after another.

udev is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the /dev directory. At the same time, udev also handles all user space events raised when hardware devices are added into the system or removed from it, including firmware loading as required by certain devices.

init UNIX system component

In Unix-based computer operating systems, init is the first process started during booting of the operating system. Init is a daemon process that continues running until the system is shut down. It is the direct or indirect ancestor of all other processes and automatically adopts all orphaned processes. Init is started by the kernel during the booting process; a kernel panic will occur if the kernel is unable to start it, or it should die for any reason. Init is typically assigned process identifier 1.

launchd is an init and operating system service management daemon created by Apple Inc. as part of macOS to replace its BSD-style init and SystemStarter. There have been efforts to port launchd to FreeBSD and derived systems.

Upstart is a discontinued event-based replacement for the traditional init daemon—the method by which several Unix-like computer operating systems perform tasks when the computer is started. It was written by Scott James Remnant, a former employee of Canonical Ltd. In 2014, Upstart was placed in maintenance mode, and other init daemons, such as systemd, were recommended in place of Upstart. Ubuntu moved away from Upstart with the release of version 15.04 in favor of migrating to systemd. As of March 2023, there have been no updates released for Upstart since September 2014.

The Linux booting process involves multiple stages and is in many ways similar to the BSD and other Unix-style boot processes, from which it derives. Although the Linux booting process depends very much on the computer architecture, those architectures share similar stages and software components, including system startup, bootloader execution, loading and startup of a Linux kernel image, and execution of various startup scripts and daemons. Those are grouped into 4 steps: system startup, bootloader stage, kernel stage, and init process. When a Linux system is powered up or reset, its processor will execute a specific firmware/program for system initialization, such as Power-on self-test, invoking the reset vector to start a program at a known address in flash/ROM, then load the bootloader into RAM for later execution. In personal computer (PC), not only limited to Linux-distro PC, this firmware/program is called BIOS, which is stored in the mainboard. In embedded Linux system, this firmware/program is called boot ROM. After being loaded into RAM, bootloader will execute to load the second-stage bootloader. The second-stage bootloader will load the kernel image into memory, decompress and initialize it then pass control to this kernel image. Second-stage bootloader also performs several operation on the system such as system hardware check, mounting the root device, loading the necessary kernel modules, etc. Finally, the very first user-space process starts, and other high-level system initializations are performed.

<span class="mw-page-title-main">Calculate Linux</span> Linux distribution

Calculate Linux is a Linux distribution optimized for fast deployment in an organization environment. It is based on the Gentoo Linux project and includes many preconfigured functions.

runit Init scheme and service supervisor for UNIX-like systems

runit is an init and service management scheme for Unix-like operating systems that initializes, supervises, and ends processes throughout the operating system. Runit is a reimplementation of the daemontools process supervision toolkit that runs on many Linux-based operating systems, as well as BSD, and Solaris operating systems. Runit features parallelization of the start up of system services, which can speed up the boot time of the operating system.

systemd Suite of system components for Linux

systemd is a software suite that provides an array of system components for Linux operating systems. The main aim is to unify service configuration and behavior across Linux distributions. Its primary component is a "system and service manager" – an init system used to bootstrap user space and manage user processes. It also provides replacements for various daemons and utilities, including device management, login management, network connection management, and event logging. The name systemd adheres to the Unix convention of naming daemons by appending the letter d. It also plays on the term "System D", which refers to a person's ability to adapt quickly and improvise to solve problems.

<span class="mw-page-title-main">Devuan</span> Linux distribution based on Debian

Devuan is a fork of the Debian Linux distribution that uses sysvinit, runit or OpenRC instead of systemd. Devuan aims to avoid "lock-in" by projects like systemd and aims to maintain compatibility with other init systems to avoid detaching Linux from other Unix systems.

<span class="mw-page-title-main">Void Linux</span> Independent distribution developed entirely by volunteers

Void Linux is an independent Linux distribution that uses the X Binary Package System (XBPS) package manager, which was designed and implemented from scratch, and the runit init system. Excluding binary kernel blobs, a base install is composed entirely of free software.

<span class="mw-page-title-main">Hyperbola GNU/Linux-libre</span> Linux distribution based on Arch Linux

Hyperbola GNU/Linux-libre is a Linux distribution for the i686 and x86-64 architectures. It is based on Arch Linux snapshots and Debian development. It includes the GNU operating system components and the Linux-libre kernel instead of the generic Linux kernel. Hyperbola GNU/Linux-libre is listed by the Free Software Foundation as a completely free operating system, true to their Free System Distribution Guidelines.

Container Linux is a discontinued open-source lightweight operating system based on the Linux kernel and designed for providing infrastructure for clustered deployments while focusing on automation, ease of application deployment, security, reliability, and scalability. As an operating system, Container Linux provided only the minimal functionality required for deploying applications inside software containers, together with built-in mechanisms for service discovery and configuration sharing.

<span class="mw-page-title-main">Artix Linux</span> Linux distribution

Artix Linux is a rolling-release Linux distribution partially based on Arch Linux, with a primary goal to provide init and service management freedom. Artix offers OpenRC, runit, s6 and dinit,. In contrast to Arch, Artix does not use systemd with the default init and service manager being OpenRC.

<span class="mw-page-title-main">Netdata</span> Open-source system monitor software

With Netdata Users can monitor their servers, containers, and applications,in high-resolution and in real-time. Netdata is an open source tool designed to collect real-time metrics, such as CPU usage, disk activity, bandwidth usage, website visits, etc., and then display them in low-latency dashboards. The tool is designed to visualize activity in the greatest possible detail, allowing the user to obtain an overview of what is happening and what has just happened in their system or application.

<span class="mw-page-title-main">GNU Guix System</span> Rolling release distribution of the GNU operating system built around the GNU Guix package manager

GNU Guix System or Guix System is a rolling release, free and open source Linux distribution built around the GNU Guix package manager. It enables a declarative operating system configuration and allows system upgrades which the user can rollback. It uses the GNU Shepherd init system and the Linux-libre kernel, with support of the GNU Hurd kernel under development. On February 3, 2015, the Free Software Foundation added the distribution to its list of endorsed free Linux distributions. The Guix package manager and the Guix System drew inspiration from and were based on the Nix package manager and NixOS respectively.

References

  1. "Release 0.53". 12 January 2024. Retrieved 19 January 2024.
  2. "openrc", Analysis Summary, Ohloh , retrieved 2012-03-10
  3. "History". GitHub . Retrieved 6 April 2020.
  4. "Developers" . Retrieved 6 April 2020.
  5. "Manjaro OpenRC 0.8.13 - reinventing init without systemd". DistroWatch Weekly, Issue 612. 1 June 2015. Retrieved 2020-04-04.
  6. "5 Differences Between TrueOS & Linux". 23 February 2018. Retrieved 6 April 2020.
  7. "Improving TrueOS: OpenRC" . Retrieved 6 April 2020.
  8. "Distro's forum - Which init system is Artix's default?" . Retrieved 2023-10-30.
  9. "Devuan ASCII 2.0.0 stable release" . Retrieved 2021-01-18.
  10. "user guide". GitHub . Retrieved 6 April 2020.
  11. "service script guide". GitHub . Retrieved 6 April 2020.
  12. "OpenRC/openrc-init". February 6, 2023. Retrieved October 7, 2023.
  13. "runit guide". GitHub . Retrieved 6 April 2020.
  14. "s6 Guide". GitHub . Retrieved 6 April 2020.
  15. "CGroups Support" . Retrieved 5 April 2020.