OpenRC
Related articles
OpenRC is a service manager maintained by the Gentoo developers. OpenRC is dependency based and works with the system provided init program, normally SysVinit.
Contents
Installation
OpenRC and accompanying packages are available in the AUR. For details on init components, see Init.
Install either openrcAUR or openrc-gitAUR. openrc-sysvinitAUR is used as init process. Services are contained in the openrc-arch-services-gitAUR package.
To maintain compability with initscripts-forkAUR, configuration files are installed to /etc/openrc/
. The sysvinit init binary is installed to /usr/bin/init-openrc
for compability with systemd-sysvcompat or similar packages.
Configuration
For more information on configuring OpenRC, see OpenRC manuals, OpenRC migration and the gentoo wiki. See Init#Configuration for generic configuration.
Enabling services
Save a list of running daemons:
$ systemctl list-units --state=running "*.service" > daemons.list
Install respective services as described in #Installation. OpenRC services are enabled by issuing the rc-update
command. For example, to enable ALSA and dbus:
# rc-update add alsa default # rc-update add dbus default
To enable udev (disabled by default):
# rc-update add udev sysinit
See also Gentoo services and Daemons list.
Booting
For booting with OpenRC add init=/usr/bin/init-openrc
to the kernel parameters. To switch back to systemd, remove the parameter again.
The /etc/openrc/conf.d
directory, and the /etc/openrc/rc.d
file is used for configuration.
Network
See Network configuration for general networking information.
The network is configured through newnet
. [1] Modify 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
.
ip_eth0="192.168.1.2/24" defaultiproute="via 192.168.1.1" 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 may also use NetworkManager, dhcpcd or netcfgAUR by enabling the respective services. netcfgAUR mimics the netctl behaviour (see [2] if you want to enable profiles connection on booting - requires wpa_actiond
). You could consult the official documentation or old wiki documentation (be aware of consulting version later than 2012-05-13)
Logging
See Init#System logging. Relevant service files are included in openrc-arch-services-gitAUR. It is recommended to only use a single logger as different loggers may conflict.
To enable boot logging, uncomment the rc_logger="YES"
line in /etc/openrc/rc.conf
.
Hostname
OpenRC sets the hostname from /etc/openrc/conf.d/hostname
. The file looks as follows:
# Set to the hostname of this machine hostname="myhostname"
Module autoloading
OpenRC uses /etc/openrc/conf.d/modules
instead of /etc/modules-load.d
. For example:
/etc/openrc/conf.d/modules
# You should consult your kernel documentation and configuration # for a list of modules and their options. modules="vboxdrv acpi_cpufreq"
Locale
Keyboard layout can be configured via /etc/openrc/conf.d/keymaps
and /etc/openrc/conf.d/consolefont
. You can also configure the settings through the /etc/locale.conf
file, which is sourced via /etc/profile.d/locale.sh
.
See [3] and Locale for details.
Troubleshooting
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
no_umounts="/tmp"
to /etc/openrc/conf.d/localmount
Disabling IPv6 does not work
One option is to add:
# 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
/etc/sysctl.conf not found
Create the file:
# touch /etc/sysctl.conf
Using OpenRC with a desktop environment
If using OpenRC with a desktop environment, ConsoleKit may help. Install the service to /etc/openrc/init.d
, and enable it:
# rc-update add consolekit default
See ConsoleKit for more information.