Difference between revisions of "OpenRC"

From ArchWiki
Jump to: navigation, search
(added troubleshooting section)
m (Locale)
(5 intermediate revisions by the same user not shown)
Line 20: Line 20:
 
  # rc-update add udev sysinit
 
  # rc-update add udev sysinit
  
{{Note|The OpenRC package lacks networking support. Take a look [[Network Configuration | here]] for configuring your network.}}
+
=== Network ===
 +
 
 +
There are multiple ways to get a network up and running. One way is by configuring the {{ic|/etc/openrc/conf.d/network}} file. Both the {{ic|ip}} ({{Pkg|iproute2}}) and the {{ic|ifconfig}} ({{Pkg|net-tools}}) commands are supported.
 +
 
 +
Below is an example configuration using {{ic|ip}}.
 +
 
 +
{{bc|
 +
<nowiki>ip_eth0="192.168.1.2/24"
 +
defaultiproute="via 192.168.1.1"
 +
ifup_eth0="ip link set \$int mtu 1500"</nowiki>}}
 +
 
 +
The network service is added to the boot runlevel by default, so no further action is required.
 +
 
 +
You can also use [[NetworkManager]], [[Dhcpcd]] or [[netcfg]] by enabling the respective services.
 +
 
 +
Take a look at [[Network Configuration]] for a detailed look at networking in general.
  
 
=== Logging ===
 
=== Logging ===
Line 47: Line 62:
 
add a line like this to that file :
 
add a line like this to that file :
 
{{bc|<nowiki>modules=acpi_cpufreq</nowiki>}}
 
{{bc|<nowiki>modules=acpi_cpufreq</nowiki>}}
 +
 +
=== Locale ===
 +
 +
There is no built-in support for configuring locales in OpenRC. Though, you can configure the settings through the {{ic|/etc/locale.conf}} file, which is sourced via {{ic|/etc/profile.d/locale.sh}}.
 +
 +
For details on configuring the locale, take a look [[Locale | here]].
  
 
== Troubleshooting ==
 
== Troubleshooting ==
  
=== tmp umount error ===
+
=== Error while unmounting /tmp ===
 +
 
 +
When shutting the system down, you might get an error message such as
  
When shutting the system down, you might get an error message such as {{ic|Unmounting /tmp, in use but fuser finds nothing!!}}
+
{{bc|* Unmounting /tmp ...
 +
* in use but fuser finds nothing [ !! ]}}
  
 
This can be fixed by adding  
 
This can be fixed by adding  

Revision as of 10:45, 19 February 2013

Note: Arch uses systemd by default. If you use OpenRC, please mention so while asking for help.

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

Installation

OpenRC is available in the AUR. 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 /sbin/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.

Configuration

For booting with OpenRC add init=/sbin/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.

For detailed instructions on configuring OpenRC, read the man pages, visit the gentoo guide and the gentoo wiki.

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

# rc-update add udev sysinit

Network

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.

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 can also use NetworkManager, Dhcpcd or netcfg by enabling the respective services.

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

Logging

syslog-ng

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

unix-dgram("/run/systemd/journal/syslog")
and add this line instead:
unix-dgram("/dev/log");
Note: Without making this change syslog-ng will fail to run and as a result nothing will be logged!

Boot logging

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

#rc_logger="YES"

Hostname

OpenRC sets the hostname from /etc/openrc/conf.d/hostname.

Here is an example file:

/etc/openrc/conf.d/hostname
hostname="myhostname"

Module autoloading

OpenRC doesn't use /etc/modules-load.d/ folder, instead it uses /etc/openrc/conf.d/modules.

add a line like this to that file :

modules=acpi_cpufreq

Locale

There is no built-in support for configuring locales in OpenRC. Though, you can configure the settings through the /etc/locale.conf file, which is sourced via /etc/profile.d/locale.sh.

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

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

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

External Links