From ArchWiki
Revision as of 13:30, 2 December 2014 by Zatherz (talk | contribs)
Jump to navigation Jump to search
Note: Arch uses systemd by default. If you use OpenRC, please mention so while asking for help.

OpenRC is an rc system maintained by the Gentoo developers. OpenRC is dependency based and works with the system provided init program, normally sysvinit. It is not a replacement for sysvinit.


OpenRC is available in the AUR.

Method A (apg's way)

You can choose to install either openrcAUR or openrc-gitAUR package. You will also need to install openrc-arch-services-gitAUR (provides service files for use with openrc on arch) and openrc-sysvinitAUR (a slightly patched version of traditional sysvinit). For the sake of compatibility with initscripts, openrc-sysvinitAUR installs the sysvinit init binary as /usr/bin/init-openrc.

The packages will be installed under /etc/openrc instead of the default location of /etc, so that users can switch to initscripts or systemd when desired.

Method B (artoo's way)

Here the main package is openrc-coreAUR (and corresponding set of scripts belonging to the openrc-base group).

Some other packages of note are displaymanager-openrcAUR and alsa-utils-openrcAUR (both grouped under the openrc-desktop group), and networkmanager-openrcAUR (from the openrc-misc group).

For the list of packages, look at the openrc packages maintained by artoo in the AUR.

A summary as well as the source for these package groups can be found at github.

eudev can also be used as udev provider instead of systemd.

Tip: The openrc-base and openrc-desktop groups are also available in pre-compiled form from the unofficial openrc-eudev repository. For more details, check out links [1] and [2].

Difference between the approaches

  • apg's version uses a special directory /etc/openrc so that sysvinit can be used as init instead of openrc if required.
  • artoo's version uses the default /etc directory to maintain compatibility with the Gentoo version (means sysvinit can not be used as init).
  • artoo's version uses netifrc for network (Gentoo default), while apg's version uses newnet.
  • apg's packages follow a monolithic pattern, with one package that contains the base openrc system, and another containing the rc scripts.
  • artoo's package are split packages, which are greater in number, but allow more control in modifying the individual components.


apg's way

For booting with OpenRC add init=/usr/bin/init-openrc to the kernel line in your bootloader configuration. If you want to switch back to systemd, change it to init=/usr/lib/systemd/systemd.

The /etc/openrc/conf.d directory, and the /etc/openrc/rc.d file is used for configuration.

It is worth noting that the udev service is not enabled by default. In order to enable it, do:

# rc-update add udev sysinit

artoo's way

OpenRC is booted by default.

To boot with systemd, add init=/usr/lib/systemd/systemd to the kernel line in your bootloader configuration.

The files in the /etc/conf.d directory are used for configuration.

Here udev is enabled by default.


For more information on configuring OpenRC, man pages are available; you can also visit the gentoo guide and the gentoo wiki.


apg's way

There are multiple ways to get a network up and running. One way is by configuring the /etc/openrc/conf.d/network file. Both the ip (iproute2) and the ifconfig (net-tools) commands are supported.

Below is an example configuration using ip.

ifup_eth0="ip link set \$int mtu 1500"

The network service is added to the boot runlevel by default, so no further action is required.

You can also use NetworkManager, dhcpcd or netcfgAUR by enabling the respective services.

artoo's way

dhcpcd is enabled by default.

For network configuration, look at the /etc/conf.d/net file.

Out of the box it uses netifrc, which defaults to dhcpcd if not specified differently in /etc/conf.d/net

dhcpcd-openrcAUR package provides a specific dhcpcd script, not to be confused with netifrc default. It will start /etc/init.d/dhcpcd

To use a static route you need to create a symlink of net.lo that reflects your device's name:

ln -s /etc/init.d/net.lo /etc/init.d/net.eth0

For more info, look at Gentoo documentation

For having a graphical network manager, networkmanager-openrcAUR can be installed.

Other options are available, like connman via connman-openrcAUR, which some has GUI front-ends:

cmstAUR (Qt), connman-ui-gitAUR (Gtk), and econnmanAUR (for Enlightenment DE).


Take a look at Network configuration for a detailed look at networking in general.


apg's way

If you use syslog-ng, comment out the following line in /etc/syslog-ng/syslog-ng.conf:


and add this line instead:

Note: Without making this change syslog-ng will fail to run and as a result nothing will be logged!

artoo's way

Many different loggers are available, like syslog-ng-openrcAUR, metalog-openrcAUR, and rsyslog-openrcAUR.

They mostly work out of the box.

These loggers may conflict with each other, hence using only a single logger is recommended.

Boot logging

apg's way

OpenRC's boot logging is disabled by default. To enable it, uncomment the following line in /etc/openrc/rc.conf

artoo's way

Boot logging is enabled by defualt.

To disable it, comment out the rc_logger="YES" line in /etc/rc.conf

Tip: Boot logs are stored in /var/log/rc.log


OpenRC sets the hostname from /etc/openrc/conf.d/hostname (apg's way) or /etc/conf.d/hostname (artoo's way).

It looks like the following:

# Set to the hostname of this machine

Module autoloading

OpenRC doesn't use /etc/modules-load.d/ folder, instead it uses /etc/openrc/conf.d/modules (apg's way) or /etc/conf.d/modules (artoo's way).

It looks like the following:

# You should consult your kernel documentation and configuration
# for a list of modules and their options.

modules="vboxdrv acpi_cpufreq"


Keyboard layout can be configured via /etc/conf.d/keymaps and /etc/conf.d/consolefont (artoo's way).

For more info, see the Gentoo wiki.

You can also configure the settings through the /etc/locale.conf file, which is sourced via /etc/profile.d/

For more details on configuring the locale, take a look here.


Error while unmounting /tmp

When shutting the system down, you might get an error message such as

* Unmounting /tmp ... 
* in use but fuser finds nothing [ !! ]

This can be fixed by adding


to /etc/openrc/conf.d/localmount

Note: This problem occurs only if your tmp is mounted as a tmpfs.

Disabling IPv6 doesn't work

If you have OpenRC installed under the /etc/openrc sysconf directory.

One fix for this is to put

# Disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1

in a file (with a .conf extension) under /etc/openrc/sysctl.d

During shutdown remounting root as read-only fails

If the above happens, edit the /etc/openrc/init.d/mount-ro file and put:

telinit u

after the following line:

# Flush all pending disk writes now
sync; sync

Using OpenRC with eudev

With OpenRC being used as init system, the role of systemd is reduced to that of a udev provider, and for compatibility reasons.

eudev is a fork of udev started by the Gentoo project, with the goal of isolation from any particular flavor of system initialization, such as systemd or sysvinit.


Note: This method may not work with apg's packages.

eudevAUR is available in the AUR. It basically serves a drop-in replacement for the udev provided by systemd.

Two packages are needed in order to install eudev: eudev-systemdcompatAUR and eudev-openrcAUR.

The eudev-systemdcompat package conflicts with systemd and libsystemd, and requires the eudevAUR package. upower-pm-utilsAUR is an optional dependency.

Note: One may not be able to install the eudev packages directly from the AUR due to conflicts when installing; to circumvent it, eudevAUR (along with libeudevAUR and eudev-openrcAUR, which are part of the same eudevAUR package) can be built and added to a local repository, and then eudev-systemdcompatAUR can be built and installed from the AUR using:
makepkg -di
(-d to ignore build dependencies), which pulls in eudev and libeudev as package dependencies.

After that eudev-openrcAUR can be installed from the local repo created earlier.

upower-pm-utilsAUR can be installed for suspend / hibernate support.
Tip: The eudev, eudev-openrc and eudev-systemdcompat packages are also available in pre-compiled form from the unofficial openrc-eudev repository. For more details, have a look at [3] and [4].

Replacing Systemd with OpenRC and Eudev

See User:Zatherz#Replacing_Systemd_with_OpenRC_and_Eudev


If your unmounted partitions are not being displayed, then that is probably due to gvfs being compiled for systemd; using gvfs-nosystemdAUR from the AUR may fix it.

Tip: If using OpenRC with a desktop environment, consolekit-openrcAUR and related consolekit packages in the AUR may help.

External Links