- 1 Overview
- 2 Groups
- 3 Basic installation
- 4 Configuration
- 5 Adaptation between systemctl and rc-update
- 6 Troubleshooting
Usually, when you install a software requiring an unit file, the base package provides a unit file for systemd, but not for openrc. You will need to add "-openrc" to obtain the unit file for OpenRC, unless it's installed from the Nonsystemd repository. For example, if you install openvpn, you also need to install openvpn-openrc, but dbus from [nonsystemd] has its init script already.
If you migrate a running system from systemd to OpenRC, the command poweroff will probably not work until after you reboot, as it will be the OpenRC version poweroff command, but systemd will still be running. You can work around this by leaving the systemd package installed (it won't be used by OpenRC after the reboot), and running systemctl poweroff, or by simply pressing the hardware power switch.
Some software, like netctl, is made for systemd, and it will not work with OpenRC. If you use netctl, you will need to select an alternative. Options include netifrc (Gentoo ("oldnet") network management), openrc-net (OpenRC ("newnet") network management, still very beta), networkmanager, dhcpcd and others.
Before Arch migrated to systemd, users had to be manually added to some groups in order to be able to access the corresponding devices. Read more about here.
Make sure your user is on the audio group, you won't have sound otherwise:
usermod -aG audio <your-user>
Same for video, your games might be laggy otherwise:
# usermod -aG video <your-user>
And for webcam:
# usermod -aG optical <your-user>
Also for storage
# usermod -aG storage <your-user> # usermod -aG disk <your-user>
And for CUPS
# usermod -aG sys <your-user>
You can reinstall Systemd when you want, its dependencies will be reinstalled as well.
3 Basic installation
3.1 Migrating from a Systemd installation
# pacman -Syu your-initfreedom elogind udev-init-scripts openrc
If you are asked to remove systemd-related packages, accept it. You'll also be asked for an OpenRC /sbin/init/ provider. There are currently two options:
3.2 Base system
To install a base OpenRC system:
# pacstrap /mnt base elogind libelogind udev-init-scripts your-initfreedom
You have a few choices you can make, or accept the defaults. Remember to install a kernel, like linux-libre or linux-libre-lts. Note that although libelogind is pulled by elogind many other packages will try to pull systemd-libs (which is provided by libelogind, but pacman tries to install systemd-libs when libelogind is not explicitly listed), that's why you must specify it even if elogind is installed along. The your-initfreedom package will make sure no systemd packages are installed in your system.
3.3 Desktop system
In addition to the other methods mentioned above, one can install the openrc-desktop package group to get most software and its init scripts needed for desktop environments:
# pacman -S openrc-desktop
4.1 Daemons often required
Once you migrate to OpenRC, you might need to add some services like NetworkManager, lvm2, etc. Here is the procedure for lvm2-openrc:
# rc-update add lvm boot
For networkmanager (from [nonsystemd]):
# rc-update add NetworkManager default
# rc-update add dmcrypt boot
# rc-update add alsasound default
# rc-update add cronie default
... and so on.
OpenRC has its configuration in /etc/conf.d/hostname. In order to set your hostname, replace the hostname variable with the name that you want:
It's recommended to remove /etc/hostname if you're migrating from Systemd, as it might cause problems to some software that uses your hostname for some tasks or operations (like NetworkManager).
As the hostname, you need to setup the keymap in the file /etc/conf.d/keymaps :
If you have an advanced usage of your keymap, you can watch the other functionalities, documented in the comments. You can find all the available keymaps in /usr/share/kbd/keymaps. Then run
# rc-service keymaps restart
4.4 Login display managerWith OpenRC, the DM is launched differently. For example, with lxdm, you need to mention lxdm in the file /etc/conf.d/xdm. If that file does not exist, install the displaymanager-openrc package. To enable LXDM, for example, set the DISPLAYMANAGER variable to:
Regardless of which DM you want to use, ensure that the 'xdm' service is enabled:
# rc-update add xdm default
Note that some DMs like xfce4-session might not work well.
5 Adaptation between systemctl and rc-update
5.1 Add or delete a service
You can add a service using this way :
# rc-update add <service> <runlevel>
And delete it as follow :
# rc-update del <service> <runlevel>
5.2 Services currently running
In order to have a summary of all the daemons running, stopped etc, you can run this command:
5.3 Stop/Start/Restart a service
To start, stop or restart a service, you need to use rc-service:
# rc-service <service> start
You can start them without needing to add them to a runlevel, but will not be started after rebooting.
6.1 /usr/lib/rc/cache doesn't exist
If you have this error when you shutdown the computer:
WARNING: /usr/lib/rc/cache is not writable!
The solution is to create the folder:
# mkdir /usr/lib/rc/cache
6.2 Swap isn't enabled
Systemd used to mount the swap automatically, you need to manually add the swap in /etc/fstab as follow :
# /dev/sda2 UUID=0c3e9434-bc5c-461c-a5e4-4e9fe5f9a149 swap swap sw 0 0
6.3 tmpfs isn't present
As the swap, systemd automatically mounts the tmpfs. Add it manually in /etc/fstab :
tmpfs /tmp tmpfs nodev,nosuid 0 0