Fact-checked by Grok 2 weeks ago

OpenRC

OpenRC is a dependency-based system designed for operating systems, which manages the initialization and control of services while maintaining compatibility with traditional system-provided programs such as SysVinit or BSD . It was developed primarily for but has been ported to various other distributions including , where it serves as the default system, and can be installed on systems like via community packages. Key features of OpenRC include support for parallel service startup to accelerate boot times, dependency resolution to ensure services start in the correct order, and integration with modern components like for resource management and for device handling. The system is lightweight with minimal dependencies, allowing it to run on resource-constrained environments, and it supports runlevels—named states such as "default" or "boot"—along with stacked runlevels for flexible service inheritance across contexts. Service management is handled through commands like rc-service for starting/stopping individual services and rc-update for adding them to runlevels, with additional capabilities for user-level services and hotplugging hardware events. OpenRC emphasizes modularity and portability, working atop existing init frameworks without replacing them entirely, and it includes optional tools like openrc-init for enhanced and elogind for compatibility with systemd-like session management features. Its design prioritizes simplicity and customization, making it suitable for systems, servers, and desktops where administrators seek alternatives to more monolithic init systems. Installation typically involves emerging the package in Gentoo or using package managers in other distros, followed by configuring kernel parameters and service files in directories like /etc/init.d/ and /etc/conf.d/.

History

Origins and Development

OpenRC was created in 2007 by Roy Marples, a developer contributing to both and , as a lightweight system designed to serve as an alternative to SysVinit while introducing built-in support for service dependencies. This development addressed key shortcomings in Gentoo's existing Baselayout, which used pure scripts for handling, leading to challenges in , , and overall . Marples' goal was to create a more modular framework that could enhance boot processes and extend portability to a broader range of operating systems beyond Gentoo. The project originated within the Gentoo ecosystem, where Marples announced the development of baselayout-2 early in 2007 as a complete rewrite of Gentoo's script design, originally conceived by Robbins. By mid-2007, alpha versions of this reimplementation were integrated into Gentoo, marking the transition from a basic service manager to a comprehensive system capable of handling system startup and shutdown. Towards the end of the year, following Marples' retirement from active Gentoo involvement, the project was renamed OpenRC and released independently, allowing it to evolve outside Gentoo's direct control while retaining strong ties to the distribution. OpenRC was licensed from the outset under the 2-clause BSD license, a choice that emphasized its open-source nature and facilitated easy adoption and modification across different platforms. The initial codebase was implemented in C99 for its core libraries and utilities, complemented by POSIX-compliant shell scripts for service definitions and runtime logic, ensuring broad compatibility with standards-based Unix environments. This approach resulted in a highly compact implementation, totaling around 10,000 lines of C code and 4,000 lines of shell script, underscoring its design focus on efficiency and minimal footprint.

Major Releases and Updates

OpenRC's development began as an extension of Gentoo's modular init scripts, with its first public release occurring in 2007 under Roy Marples, who introduced core dependency-based service management to enable ordered and parallel startup of system processes. A significant enhancement came in version 0.21, released in June 2016, which added the supervise-daemon utility for , allowing OpenRC to monitor and automatically restart daemons that terminate unexpectedly. Version 0.25, issued in April 2017, marked a key evolution by incorporating openrc-init, OpenRC's own 1 implementation, which serves as a for traditional SysVinit systems and eliminates the need for external dependencies while supporting full boot and shutdown orchestration. Since Roy Marples handed over maintenance around 2010, OpenRC has been stewarded by the Gentoo OpenRC Project and broader OpenRC Developers group, evolving into a distro-neutral solution with contributions from communities including and to enhance portability across and BSD environments. As of November 2025, the latest stable release is version 0.63, incorporating ongoing maintenance such as bug fixes for BSD compatibility, default enablement of cgroup v2 support since version 0.51 in 2023, and refinements to parallel service execution for faster boot times.

Design

Core Components

OpenRC's architecture is built around a set of modular components that enable dependency-based management while maintaining compatibility with existing init systems. The primary module is rc, which serves as the main framework responsible for orchestrating system initialization, startup, and shutdown processes. Written primarily for efficiency and portability, rc parses shell scripts located in the /etc/init.d to construct a , allowing services to start in the correct order based on declared needs and uses. Since version 0.25, OpenRC includes openrc-init, an optional init program that can fully replace the traditional /sbin/init (such as SysVinit) for standalone operation on Linux systems. By default, OpenRC integrates with the system's provided init, invoking rc during boot via mechanisms like inittab entries, but openrc-init enables a more self-contained setup by handling process ID 1 responsibilities directly. This component enhances flexibility for distributions seeking to minimize external dependencies while preserving OpenRC's core functionality. Another key optional module is supervise-daemon, introduced as part of OpenRC since version 0.21, which acts as a supervisor for managing daemons. It monitors child processes, restarts them if they terminate unexpectedly, and handles logging of stdout and stderr, providing a consistent method for starting, stopping, and restarting services without requiring external tools like start-stop-daemon in all cases. Supervise-daemon keeps daemons in the foreground as direct children, using files to track supervision status. OpenRC's design emphasizes portability through its C-based core and use of POSIX-compliant scripts, supporting deployment on and without major modifications. The engine relies on standardized scripting conventions, where interdependencies are declared via keywords in script headers, enabling cross-platform consistency. Additionally, OpenRC offers optional compatibility with external such as or s6, configurable via parameters in init scripts (e.g., supervisor=s6), allowing users to leverage specialized process monitoring tools alongside OpenRC's management.

Service Management and Dependencies

OpenRC service scripts are stored in the /etc/init.d directory and are implemented as POSIX-compliant shell scripts, typically starting with #!/sbin/openrc-run. These scripts must include core functions such as start(), stop(), restart(), and status(), along with a depend() function to declare inter-service relationships. The depend() function uses keywords to specify prerequisites, enabling OpenRC to resolve startup order automatically while maintaining compatibility with traditional SysVinit practices. Since version 0.60, OpenRC supports user services, with the feature stabilized as of September 2025. Dependency declarations in OpenRC support both hard and soft requirements, as well as sequencing controls. The need keyword enforces a hard, one-time dependency, ensuring the specified starts (if not already running) before the current proceeds; for instance, need net requires network services to be active for services like SSH. In contrast, use indicates a soft, ongoing , assuming the service is available without attempting to start it, such as use dns for name resolution that persists during the service's runtime. The after keyword handles ordering without dependency enforcement, like after logger to sequence initialization, while before reverses this for reverse ordering. Additional keywords include want for optional startups and provide to allow one script to fulfill multiple service types. These mechanisms support conditional dependencies via variables in /etc/conf.d/ files, allowing dynamic behavior based on system state. OpenRC also permits parallel execution of independent services to optimize boot times. Service management in OpenRC relies on dedicated tools for configuration and control. The rc-update utility manages runlevel associations by adding or removing symlinks in /etc/runlevels/, for example, rc-update add sshd default to enable the SSH service in the default runlevel, or rc-update del sshd boot to remove it from the boot runlevel. Manual operations use rc-service, which invokes script functions directly, such as rc-service net.eth0 start to activate a network interface or rc-service sshd status to check runtime state. Monitoring is facilitated by rc-status, which displays overall system status or filters by service, like rc-status -a for all services or rc-status --servicelist for a concise list. Runlevels follow SysV-style conventions with defaults like sysinit, boot, and default, but OpenRC extends this by supporting custom runlevels through directory creation in /etc/runlevels/ and stacked configurations via rc-update -s. Error handling and are integrated into OpenRC's framework for reliability. Scripts use helper functions like ebegin and eend to output messages and handle return codes, ensuring failures are reported clearly during execution. is enabled by setting rc_logger="YES" in /etc/rc.conf, directing output to /var/log/rc.log for post-boot analysis of startup issues or errors. Conditional dependencies can incorporate checks, such as testing variables in start_pre() or stop_pre() hooks to validate configurations before proceeding, preventing cascading failures. For crashed services, rc-service <service> zap resets the state without full reinitialization.

Features

Boot and Shutdown Processes

The boot process in OpenRC begins with the kernel invoking the init program, typically SysV init or the optional openrc-init (available since OpenRC 0.25), which consults /etc/inittab to execute the sysinit runlevel via /sbin/openrc sysinit. This runlevel processes scripts in /etc/runlevels/sysinit, handling essential hardware initialization, filesystem mounting as defined in /etc/fstab, and basic system setup such as loading kernel modules and configuring consoles. Following sysinit, init triggers the boot runlevel with /sbin/openrc boot, executing scripts in /etc/runlevels/boot for additional low-level tasks like setting up networking basics and local filesystems. The sequence then advances to the default runlevel via /sbin/openrc default (or another specified runlevel from the kernel command line using the softlevel parameter), where user-oriented services in /etc/runlevels/default are started. Service startup order is determined by a dependency graph derived from keywords like need, use, want, before, and after in the service scripts located in /etc/init.d/, ensuring prerequisites are met before dependent services launch. Optional parallelism in the boot process allows non-dependent services to start concurrently, potentially reducing overall boot time, and is enabled by setting rc_parallel="YES" in the global /etc/rc.conf. This feature processes independent scripts simultaneously while respecting dependency constraints, though it is considered experimental in some implementations and may require careful testing to avoid issues with service ordering. System-wide settings like boot delays can also be tuned in /etc/rc.conf to accommodate hardware-specific needs, such as adding a pause before proceeding to the next . The shutdown process reverses the boot sequence by traversing the in opposite order, stopping services cleanly to allow proper release and cleanup. Initiated via commands like openrc shutdown or through signals, it first halts the default services, then , and finally sysinit-related components, with configurable timeouts per service to wait for graceful stops before resorting to force-kill options if necessary. During both and shutdown, OpenRC provides colorized console output for , using for successful actions, for failures, and for warnings, enhancing on the terminal. Verbose modes can be activated for by adjusting settings in /etc/rc.conf or using command-line flags, displaying detailed execution traces. Persistent logging is available by enabling rc_logger="YES" in /etc/rc.conf, directing output to /var/log/rc.log for post-boot analysis. setup integrates global parameters from /etc/rc.conf with per-service overrides in /etc/conf.d/, allowing customized variables like network interfaces or daemon options to influence the processes without altering core scripts.

Advanced Functionalities

OpenRC provides daemon supervision through the supervise-daemon tool, which starts daemons as child processes and automatically restarts them upon unexpected termination to ensure service reliability. This tool captures the daemon's stdout and stderr for , using a file for the supervisor itself rather than the daemon, allowing seamless restarts without external intervention. Administrators can configure respawn in init scripts by setting supervisor="supervise-daemon", along with options like command_args_foreground to prevent daemonization and pidfile for supervisor tracking; for instance, in the acpid service, killing the process triggers an immediate restart, demonstrating the tool's effectiveness in maintaining uptime. For resource management, OpenRC integrates with control groups () to impose per-service limits on CPU and usage, creating a hierarchical structure under an openrc controller for organized . Activation occurs via rc_controller_cgroups="YES" in /etc/rc.conf, supporting both hybrid cgroups v1/v2 modes or unified v2 by default since OpenRC 0.51, with controllers like cpu and memory enabled for fine-grained control. Per-service configurations in /etc/conf.d/<service> allow settings such as rc_cgroup_settings="cpu.max 1500000 1000000\nmemory.high 4G" for v2, enforcing limits like 1.5 seconds of per second and a 4 GB soft cap, while rc_cgroup_cleanup="yes" ensures complete termination on service stop. This integration extends to user namespaces for enhanced isolation, enabling container-like environments by grouping related processes without requiring full container runtimes. OpenRC handles complex multi-process services through customizable init scripts that manage multiple daemons via dependency chains and conditional logic, ensuring coordinated starts and stops. For example, the Samba service script conditionally launches smbd for , nmbd for name resolution, and winbindd for based on configuration flags like samba_nmbd or samba_winbindd, using start-stop-daemon to handle each process independently while respecting overall service . This approach allows services like to operate as a cohesive unit, starting only necessary components to optimize resource use and reliability. User services in OpenRC enable non-root management, allowing individual users to control personal daemons without system-wide privileges, introduced in version 0.60 (experimental). Scripts reside in /etc/user/init.d/ with configurations in /etc/user/conf.d/, managed via rc-service --user <service> start and user-specific runlevels in ${XDG_CONFIG_HOME}/rc/runlevels/, requiring XDG_RUNTIME_DIR for state (often set by elogind or shell profiles). Services are added with rc-update --user add <service>, and PAM integration via pam_openrc.so automates session initialization, permitting users to run tools like as themselves for isolated, secure operation. As of November 2025, the latest version of OpenRC is 0.63. OpenRC's extensibility supports hooks for third-party supervision tools, enhancing its core functionality with specialized process management. The s6 USE flag installs s6-linux-init for integration with the s6 suite, allowing s6 to handle daemon supervision in place of supervise-daemon, while can serve as a backend for process restarting through custom init script adaptations. Additionally, networking dependencies are -aware, with netifrc permitting service reliance on -enabled interfaces like net.eth0 via /etc/conf.d/net configurations, ensuring services wait for full connectivity before starting.

Adoption

Primary Distributions

OpenRC serves as the default init system in several prominent Linux distributions, each adopting it for its lightweight design, dependency management, and compatibility with traditional Unix-like systems. Gentoo Linux, the original home of OpenRC, has utilized it since its inception to support the distribution's source-based package management, allowing users extensive flexibility in compiling and optimizing software for their hardware. Artix Linux, an Arch Linux derivative created to provide a systemd-free alternative, defaults to OpenRC while emphasizing lightweight desktop environments suitable for performance-oriented users. Alpine Linux employs OpenRC as its default init system to maintain minimalism, particularly in containerized and embedded applications, where custom optimizations enhance its efficiency in resource-constrained environments. Devuan, a fork of Debian GNU/Linux, incorporates OpenRC as an alternative to systemd, prioritizing init system freedom and compatibility with diverse software ecosystems. Funtoo Linux, a variant of Gentoo focused on advanced customization, maintains OpenRC as its core init system to enable fine-grained control over system services and dependencies. Hyperbola GNU/Linux-libre, an Arch Linux-based distribution focused on free software, uses OpenRC as its default init system to provide a lightweight and customizable boot process.

Availability and Integrations

OpenRC is available as an optional package in through the Arch User Repository (AUR), allowing users who prefer alternatives to to install and configure it manually for service management. This setup typically involves installing the core package along with compatible service scripts, often requiring adjustments to boot configurations and dependency handling to replace the default integration. In and its derivatives, OpenRC has been available in the official repositories since 2014 (version 0.13.1-4 in Jessie), enabling as a dependency-based service manager that can integrate with SysV scripts or operate standalone. Users can switch to OpenRC during by selecting it in the installer or post- by installing the necessary packages and linking /sbin/ to openrc-init, while maintaining compatibility with 's ecosystem. PostmarketOS, a mobile-oriented targeting devices, employs as its default system, with specific extensions for telephony services such as oFono integration for / applications. These extensions include init scripts that handle management and voice audio during calls, facilitated by packages like q6voiced-openrc for Qualcomm-based hardware. Porting efforts for BSD systems like have been explored, but no official ports are currently available. OpenRC demonstrates strong compatibility with container runtimes like , particularly in distributions such as , where it manages services within containers using softlevel mode to avoid full bootstrapping. For hybrid setups, OpenRC can integrate with other init systems like Upstart or by leveraging its design to run atop the host's provided init program, allowing selective service supervision in mixed environments.

References

  1. [1]
    The OpenRC init system - GitHub
    OpenRC is a dependency-based init system that works with the system-provided init program, normally /sbin/init.
  2. [2]
    OpenRC - Gentoo Wiki
    OpenRC is a dependency-based init system for Unix-like systems that maintains compatibility with the system-provided init system, normally located in /sbin/ ...Implementation · Installation · Usage · System integration
  3. [3]
    OpenRC - Alpine Linux Wiki
    Alpine Linux uses OpenRC for its init system. The init system manages the services, including the boot and shutdown of your system. OpenRC also supports ...1Quickstart · 2Runlevels · 7Preventing slow services... · 8User services
  4. [4]
    OpenRC - ArchWiki
    Apr 26, 2025 · OpenRC is a service manager maintained by the Gentoo developers. OpenRC is dependency based and works with the system provided init program, normally SysVinit.
  5. [5]
    [PDF] OpenRCBy Benedict Reuschling - FreeBSD Foundation
    OpenRC was written by Roy Marples, a NetBSD developer. Gentoo, PacBSD, UbuntuBSD, and others use OpenRC. Work on OpenRC originally started in the Gentoo alt ...
  6. [6]
    Package:OpenRC - Funtoo
    Dec 6, 2020 · By mid 2007, Roy Marples had re-implemented the Gentoo init script design created by Daniel Robbins, using an entirely new code base. Alpha ...Missing: origins | Show results with:origins
  7. [7]
    OpenRC on FreeBSD
    Dec 19, 2018 · ... init system by Roy Marples, developed for the Gentoo Alt (FreeBSD) ... License: OpenRC is a BSD licensed RC init system written in C ...
  8. [8]
    ComputerDruid/openrc: clone of http://git.overlays.gentoo ... - GitHub
    By Mid 2007 I have re-written everything, including init ... About. clone of http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git · roy.marples.name/projects/ ...
  9. [9]
    OpenRC/openrc-init - Gentoo Wiki
    A UNIX or Linux operating system always has an init process which is the first process to start after the kernel loads. It is the direct or indirect parent ...
  10. [10]
    openrc package versions - Repology
    Versions for openrc ; Alpine Linux 3.17 · openrc-doc · 0.45.2 ; Alpine Linux 3.17 · openrc-zsh-completion · 0.45.2 ; Alpine Linux 3.18 · agetty-openrc · 0.48 ; Alpine ...
  11. [11]
    OpenRC - Wikidata
    ... OpenRC/openrc/releases/tag/0.21.1. 0.21.2. publication date. 6 July 2016. 1 reference. retrieved. 22 July 2018. title. Release 0.21.2 (English). publication ...
  12. [12]
    Writing Init Scripts - Alpine Linux Wiki
    Sep 19, 2025 · This page provide you with some basic information on how to write your own OpenRC init scripts. Many of the current init.d scripts found in ...
  13. [13]
    OpenRC - Debian Wiki
    OpenRC is a dependency based init system originated from Gentoo base system, while being kernel and distro neutral by using only C(ISO/IEC 9899:1999, aka. C99) ...
  14. [14]
    Main / OpenRC - Artix Wiki
    Sep 22, 2025 · OpenRC is a dependency-based init system that initially maintained compatibility with sysvinit and, beginning with OpenRC 0.25, replaced /sbin/init with its ...
  15. [15]
    OpenRC/supervise-daemon - Gentoo Wiki
    Jul 26, 2024 · Supervise-daemon is OpenRC's daemon supervisor. It can start, stop and restart system processes when they terminate unexpectedly.Missing: 0.21 | Show results with:0.21
  16. [16]
    supervise-daemon(8) — openrc — Debian experimental
    Jun 24, 2025 · supervise-daemon provides a consistent method of starting, stopping and restarting daemons. If -K , --stop or -s , --signal is not provided, ...Missing: 0.21 | Show results with:0.21
  17. [17]
    Process supervision - Gentoo Wiki
    Mar 30, 2023 · OpenRC friendly Runit stage 1, 2, and 3 along with a Ctrl + Alt + Delete files are available as well, notwithstanding the compatibility mode ...
  18. [18]
    manpages: openrc-run(8) - Linux Howtos
    ... supervise-daemon which is a light-weight supervisor internal to OpenRC. To use s6, set supervisor=s6. or set supervisor=supervise-daemon to use supervise-daemon ...
  19. [19]
    File: service-script-guide.md - Debian Sources
    Nov 1, 2025 · # Syntax of Service Scripts Service scripts are shell scripts. OpenRC aims at using only the standardized POSIX sh subset for portability ...
  20. [20]
  21. [21]
  22. [22]
    Handbook:AMD64/Working/Initscripts - Gentoo wiki
    ### Summary of Initscripts from Gentoo AMD64 Handbook
  23. [23]
    Working with OpenRC - Alpine Linux Documentation
    Working with OpenRC. OpenRC is the init system used in alpine. The init system manages the services, startup and shutdown of your computer.
  24. [24]
    supervise-daemon(8) — openrc — Debian testing
    Aug 18, 2025 · supervise-daemon provides a consistent method of starting, stopping and restarting daemons. If -K, --stop or -s, --signal is not provided, then we assume we ...Missing: 0.21 | Show results with:0.21<|control11|><|separator|>
  25. [25]
    OpenRC/CGroups - Gentoo Wiki
    Nov 29, 2024 · OpenRC includes support for cgroups. Cgroup support is implemented following the recommendations from freedesktop.org.Missing: BSD | Show results with:BSD
  26. [26]
    Handbook:Parts/Working/Initscripts - Gentoo Wiki
    Mar 11, 2025 · si::sysinit:/sbin/openrc sysinit. This line tells init that it must ... openrc default l6:6:wait:/sbin/openrc reboot. The line that ...
  27. [27]
    OpenRC/Legacy user services - Gentoo Wiki
    Oct 3, 2025 · This page tries to present a few workarounds to implement user services on OpenRC-systems, first using OpenRC itself in combination with PAM, then using a ...
  28. [28]
    s6-rc - Gentoo Wiki
    s6-rc is a service manager for s6-based systems, ie a suite of programs that can start and stop services, both long-running daemons and one-time initialization ...
  29. [29]
    Netifrc - Gentoo Wiki
    netifrc is Gentoo's default framework for configuring and managing network interfaces on systems running OpenRC. ... Network bridge, multiple interfaces, IPv6.Talk:Netifrc · Project · Netifrc/Brctl MigrationMissing: dependencies | Show results with:dependencies
  30. [30]
    Archlinux, systemd-free - Artix Linux
    It uses OpenRC as its default init system with support for s6 and runit. People using our [arch-openrc] and [arch-nosystemd] repositories and people using ...Init · Installation · Migration · Configuration<|control11|><|separator|>
  31. [31]
    Init Freedom | Devuan GNU+Linux Free Operating System
    Init Freedom is about restoring a sane approach to PID1 that respects portability, diversity and freedom of choice. Devuan uses the sysvinit init system by ...
  32. [32]
    Initialization Systems - Funtoo
    Jan 27, 2023 · OpenRC. (Uses sys-apps/sysvinit). sys-apps/openrc is Funtoo's default and preferred init system. Funtoo OpenRC is an independently-maintained ...
  33. [33]
  34. [34]
    Debian -- Details of source package openrc in sid
    Debian Package Source Repository ( VCS : Git): https://salsa.debian.org/debian/openrc.git; Debian Package Source Repository (Browsable): https://salsa.debian ...Missing: 2018 | Show results with:2018
  35. [35]
    Debian -- Package Search Results -- openrc
    You have searched for packages that names contain openrc in all suites, all sections, and all architectures. Found 8 matching packages.Missing: 2018 | Show results with:2018
  36. [36]
    ofono-openrc - postmarketOS packages
    Nov 29, 2022 · ofono-openrc. Version, 9999-r13. Description, Infrastructure for building mobile telephony (GSM/UMTS) applications [1.33] (OpenRC init scripts).
  37. [37]
    q6voiced-openrc - postmarketOS packages
    Nov 28, 2022 · Package, q6voiced-openrc. Version, 0_git20210408-r0. Description, Enable q6voice audio when call is performed with oFono/ModemManager ...Missing: telephony | Show results with:telephony
  38. [38]
    rc.d - FreeBSD Manual Pages
    HISTORY The rc utility appeared in 4.0BSD. FreeBSD 14.3 September 20, 2024 ... rc.d&manpath=FreeBSD+14.3-RELEASE+and+Ports>. home | help · Legal Notices ...Missing: OpenRC | Show results with:OpenRC
  39. [39]
    The pkgsrc guide - NetBSD
    Jul 24, 2025 · pkgsrc is a centralized package management system for Unix-like operating systems. This guide provides information for users and developers of pkgsrc.