Difference between revisions of "OpenRC"

From ArchWiki
Jump to: navigation, search
m (Removed the references to /sbin/init. They were slightly misleading since openrc-sysvinit calls it init-openrc.)
(Added note about autoloading)
(One intermediate revision by one other user not shown)
Line 12: Line 12:
 
== Configuration ==
 
== Configuration ==
  
For booting with OpenRC add {{Ic|1=init=/sbin/init-openrc}} to the kernel line in your bootloader configuration. If you want to go back to systemd replace it with {{ic|1=init=/usr/lib/systemd/systemd}}.
+
For booting with OpenRC add {{Ic|1=init=/sbin/init-openrc}} to the kernel line in your bootloader configuration. If you want to switch back to systemd, change it to {{ic|1=init=/usr/lib/systemd/systemd}}.
  
 
For detailed instructions on configuring OpenRC, read the [http://www.calculate-linux.org/main/en/openrc_manuals man pages], visit the [http://www.gentoo.org/doc/en/openrc-migration.xml gentoo guide] and the [http://wiki.gentoo.org/wiki/OpenRC gentoo wiki].
 
For detailed instructions on configuring OpenRC, read the [http://www.calculate-linux.org/main/en/openrc_manuals man pages], visit the [http://www.gentoo.org/doc/en/openrc-migration.xml gentoo guide] and the [http://wiki.gentoo.org/wiki/OpenRC gentoo wiki].
Line 24: Line 24:
 
=== Logging ===
 
=== Logging ===
  
 +
====syslog-ng====
 
If you use syslog-ng, comment out the following line in {{ic|/etc/syslog-ng/syslog-ng.conf}}:
 
If you use syslog-ng, comment out the following line in {{ic|/etc/syslog-ng/syslog-ng.conf}}:
 
{{bc|unix-dgram("/run/systemd/journal/syslog")}}
 
{{bc|unix-dgram("/run/systemd/journal/syslog")}}
 
and add this line instead: {{bc|unix-dgram("/dev/log");}}
 
and add this line instead: {{bc|unix-dgram("/dev/log");}}
{{Note|If you do not do this, NOTHING will be logged!}}
+
{{Note|Without making this change syslog-ng will fail to run and as a result nothing will be logged!}}
  
OpenRC's boot logging is disabled by default. To anable it, uncomment the following line in {{ic|/etc/openrc/rc.conf}}:
+
====Boot logging====
 +
OpenRC's boot logging is disabled by default. To enable it, uncomment the following line in {{ic|/etc/openrc/rc.conf}}:
 
{{bc|<nowiki>#rc_logger="YES"</nowiki>}}
 
{{bc|<nowiki>#rc_logger="YES"</nowiki>}}
  
Line 39: Line 41:
 
<nowiki>hostname="myhostname"</nowiki>
 
<nowiki>hostname="myhostname"</nowiki>
 
}}
 
}}
 +
 +
=== Module autoloading ===
 +
OpenRC doesn't use /etc/modules-load.d/ folder, instead it uses {{ic|/etc/openrc/conf.d/modules}}.
 +
 +
add a line like this to that file :
 +
{{bc|<nowiki>modules=acpi_cpufreq</nowiki>}}
  
 
== External Links ==
 
== External Links ==
 
* [[Wikipedia:OpenRC]]
 
* [[Wikipedia:OpenRC]]
 
* [https://bbs.archlinux.org/viewtopic.php?id=152606 Forum thread about OpenRC in Arch]
 
* [https://bbs.archlinux.org/viewtopic.php?id=152606 Forum thread about OpenRC in Arch]

Revision as of 00:28, 31 December 2012

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
Warning: The openrc package lacks networking support. You can use net-tools or netcfg to deal with that.

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

External Links