Manjaro OpenRC, an alternative to systemd

OpenRC, an alternative to systemd

From Manjaro
Revision as of 07:30, 9 June 2014 by imported>Aaditya (→‎replace do with run)

OpenRC is an init system maintained by the 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.

It can be used as an alternative to systemd, for users that like more control over their system and do not want all the features that systemd provides and automatically activates.

Installation

OpenRC is currently available from the AUR, and from a binary repository curtsy Archbang and artoo.

To use the binary repos, add the following near the end of the /etc/pacman.conf file:

[openrc]
SigLevel = Optional TrustAll
Server = http://archbang.org/repos/$repo/$arch

[aur-nosystemd]
SigLevel = Optional TrustAll
Server = http://archbang.org/repos/$repo/$arch

And then run sudo pacman -Syu to synchronise the reposotories.

The main package to install is openrc-base. It installs a binary init sysvinit (sysvinit), and the OpenRC base scripts and configuration.

To install the openrc-base package, use:

sudo pacman -S openrc-base

This package conflicts with systemd-sysvcompat, which will be removed. The output looks like:

sudo pacman -S openrc-base
resolving dependencies...
looking for inter-conflicts...
:: openrc-base and systemd-sysvcompat are in conflict. Remove systemd-sysvcompat? [y/N] y

Packages (3): systemd-sysvcompat-212-3 [removal]  sysvinit-2.88-15
             openrc-base-0.12.4-12

Total Download Size:    0.24 MiB
Total Installed Size:   0.96 MiB
Net Upgrade Size:       0.95 MiB

:: Proceed with installation? [Y/n]

After installing the openrc-base package, OpenRC should boot by default instead of systemd. Note that it will boot to a command line, as the service for a graphical display manager has not yet been installed.

On installing the openrc-base package, you may get messages like:

run 'rc-update add cronie default'
run 'rc-update add dhcpcd default'

Running these commands adds the services to the specified runlevels. For example if you run:

sudo rc-update add cronie default

Then the cronie service would be added to the default runelevel and would automatically be started at boot.

Additional packages

Display Manager

To boot to a graphical display manager, install the openrc-displaymanager package, and edit the /etc/conf.d/xdm file to specify your display manager. For example, to use lightdm, I changed the line

DISPLAYMANAGER="xdm"

to

DISPLAYMANAGER="lightdm"

Note:

lightdm and a lightdm-greeter should be installed and configured to use lightdm as display manager.

An alternative to lightdm that I find simpler is LXDM. However the version in the repos does not automatically start a ck-session on login; alternative lxdm-consolekit from the AUR can be used.

Audio (ALSA)

The alsa-utils-openrc package can be installed. After installing it run:

sudo rc-update add alsasound default

to automatically start Alsa at boot.

Network Manager

By default dhcpcd is installed. However if you use Wifi to connect, or need a graphical network applet, then networkmanager-openrc can be installed.

The networkmanager-openrc replaces the normal networkmanager package in the repos. Also, it requires consolekit and polkit-consolekit, which replaces the normal polkit from the repos.

Consolekit

You may also wish to install consolekit-openrc, which supports multi-user setups, mounting of partitions by unauthorised users, etc. See the Gentoo-Wiki for more details.

Only caveat of installing consolekit is that it requires polkit-consolekit, which conflicts with the normal polkit; so if you boot to systemd you wont be able to mount partitions if you are not in the storage group.

However using the command line, or as root user, one can mount any partition or perform most functions that are made available to the normal user via polkit. See the Arch-wiki for more details.

Others

For acpi support acpid-openrc can be installed and enabled.

For running the ps command, the procps-ng-nosystemd package can be installed.

To suspend and hibernate via the command line, pm-utils can be installed. You may also need the upower-nosystemd-pm-utils package if suspend and hibernate does not work. Also see the troubleshooting section for enabling swap.

Troubleshooting

When booting, you may get errors like:

tmpfiles: ignoring invalid entry on line 32 of `/usr/lib/tmpfiles.d//legacy.conf'
tmpfiles: ignoring invalid entry on line 33 of `/usr/lib/tmpfiles.d//legacy.conf'
tmpfiles: ignoring invalid entry on line 34 of `/usr/lib/tmpfiles.d//legacy.conf'
tmpfiles: ignoring invalid entry on line 11 of `/usr/lib/tmpfiles.d//systemd-nologin.conf'
tmpfiles: ignoring invalid entry on line 18 of `/usr/lib/tmpfiles.d//x11.conf'


To correct, I removed the lines referenced in the above files. These errors have been fixed by the developers on github, and should be available in the next release.

The boot logs for OpenRC are stored in /var/log/rc.log

If you were using systemd on a GPT partitioned hard disk, then you may need to enable swap via /etc/fstab. This is so because systemd handled swap automatically on GPT partitions, and gave error if it was mounted via fstab.

I added the following entry to my /etc/fstab

# /dev/sda10
UUID=0c3e9434-bc5c-461c-a5e4-4e9fe5f9a149	swap	swap	sw	0	0

Also, systemd used to set a tmpfs by default; to set it manually via /etc/fstab, I added the following lines:

tmpfs		/tmp		tmpfs   nodev,nosuid          	0  	0

See the Arch Wiki for more details.

Further Reading

The Arch Wiki

OpenRC on Arch Linux

Using OpenRC on Arch / Archbang / Manjaro Linux

Support

Following is a link to this page's forum counterpart where you can post any related feedback: [1]

Cookies help us deliver our services. By using our services, you agree to our use of cookies.