Installation




IMPORTANT NEWS!

TL;DR: Arch-OpenRC is deprecated; all work is now focused on
Artix Linux

Some say it's really hard to migrate from systemd to openrc


But they're wrong!

In fact, removing systemd and installing openrc is just one pacman command away. What's slightly more time consuming is configuring afterwards the system for OpenRC, but not that much. This may be a serious procedure as it involves the init system, but by no means difficult. Just pay attention to the steps and keep an eye at the output of your commands.

Having reached this page probably means you're an experienced user; why else would you want to remove systemd?

For our convenience

Two unofficial repositories exist at the moment that contain all the openrc/eudev packages there exist in the AUR: [openrc-eudev] and [pfkernel]. The former is used in this guide, as it's exclusively dedicated to OpenRC/eudev and aptly maintained.

For clarity's sake, I've broken down the procedure in simple, easy to follow steps. A summary of the steps will be given at the end of the article, of course with the long pacman one-liner.

A word of caution

Don't be lazy, don't just copy/paste a few lines; read carefully and understand what you are about to do. While you won't get an unbootable system if you just copy/paste these, you might end up with reduced or weird functionality, especially in your desktop environment. Some decisions are required from your part, according to your setup. Do read the configuration section afterwards.

Description Commands
1 Append the [openrc-eudev] repository to /etc/pacman.conf (all commands here need root privileges). [openrc-eudev] SigLevel=PackageOptional Server=http://downloads.sourceforge.net/project/archopenrc/$repo/$arch echo -e "[openrc-eudev]\nSigLevel=PackageOptional\nServer=http://downloads.sourceforge.net/project/archopenrc/\$repo/\$arch" >> /etc/pacman.conf
2 Save a list of your running daemons. systemctl list-units --state=running "*.service" > daemons.list
3 Refresh the database and list the packages in [openrc-eudev]. The ones ending in -openrc are start/stop scripts for various daemons. Compare with the list from step 2.

Fetch the basic packages in cache (not really mandatory, but better safe than sorry).
pacman -Syl openrc-eudev

pacman -Sw sysvinit openrc-core eudev eudev-openrc eudev-systemdcompat dbus-nosystemd procps-ng-nosystemd syslog-ng-nosystemd
4 Remove systemd and family (answer 'yes' to all pacman questions below). If you do this you MUST also complete step 5, otherwise you're left without init system. pacman -Rdd systemd libsystemd
5 Install openrc and family (eudev-systemdcompat provides systemd and libsystemd dependencies for packages that are linked against libsystemd).
Some systems, especially of pre-2012 installations might have leftover sysvinit configuration files. In such a case, either remove or rename them. Or you can keep calm and use '--force' to overwrite them.
pacman -S sysvinit openrc-core eudev eudev-openrc eudev-systemdcompat

If steps 4 and 5 have been completed, then your system is ready to boot with init/OpenRC.
However it's recommended to install some additional packages and perform some configuration before rebooting.

6 Recommended packages:
- procps-ng-nosystemd because procps-ng's binaries are hardlinked to libsystemd and won't work.
- dbus-nosystemd because, well, dbus.
pacman -S --needed dbus-nosystemd procps-ng-nosystemd
7 Install the openrc scripts for your daemons from step 2 (edit for your setup). pacman -S --needed acpid-openrc alsa-utils-openrc autofs-openrc consolekit consolekit-openrc cronie-openrc dbus-openrc cups-openrc displaymanager-openrc fuse-openrc haveged-openrc hdparm-openrc openssh-openrc samba-openrc syslog-ng-openrc avahi-openrc
8 The followins steps concern system-wide settings; for desktop configuration we'll elaborate in Configuration. First, enable necessary daemons. for daemon in acpid alsasound autofs dbus consolekit cronie cupsd xdm fuse haveged hdparm smb sshd atd; do rc-update add $daemon default; done
9 Edit /etc/rc.conf to your liking.

If you want to boot into X, edit /etc/conf.d/xdm and replace 'xdm' with your display manager (e.g. 'lxdm' or 'mdm') and enable xdm.

OpenRC reads /etc/conf.d/modules instead of systemd's /etc/modules-load.d/.
vi /etc/rc.conf

vi /etc/conf.d/xdm; rc-update add xdm default

vi /etc/conf.d/modules
10 Copy all sysctl settings into /etc/sysctl.conf and edit. Alternatively, install procps-ng-nosystemd, but before creating /etc/sysctl.conf because it's provided by the package.

Save your hostname where OpenRC can find it.

Edit your locale settings.
cat /etc/sysctl.c/*.conf >> /etc/sysctl.conf; vi /etc/sysctl.conf

echo "hostname="`hostname` >| /etc/conf.d/hostname

vi /etc/conf.d/keymaps; vi /etc/conf.d/consolefont; vi /etc/locale.conf
11 Edit /etc/conf.d/net, especially if this is a remote box. Assuming the main network interface is eth0, set its IP and default route and make a symlink of /etc/init.d/net.lo -> /etc/init.d/net.eth0. vi /etc/conf.d/net; cd /etc/init.d; ln -s net.lo net.eth0; rc-update add net.eth0 boot
12 If you have an LVM setup, you need lvm2-openrc and device-mapper-openrc, otherwise your logical volumes will be inactive after reboot. pacman -S lvm2-openrc device-mapper-openrc
rc-update add lvm boot; rc-update add device-mapper boot
13 Remove some systemd-only users (optional). for user in systemd-journal systemd-journal-gateway systemd-timesync systemd-network systemd-bus-proxy systemd-journal-remote systemd-journal-upload; do userdel $user; done
14 Make sure you remove any 'init=/usr/lib/systemd/systemd' or similar directives in your bootloader config, if any. The linux kernel by default launches /sbin/init. Also, remove any 'x-systemd' directives from /etc/fstab. vi /etc/grub/grub.cfg ; vi /etc/fstab
15 Packages for desktop users. Read Configuration for better explanation, this step is here for the sake of completeness.

Make sure that a graphical authentication agent is installed and autostarted on login. Cinnamon, GNOME, KDE, LXDE, LXQt, MATE and Xfce have an authentication agent already. See this section of Polkit if unsure.

Finally, become member of some groups (for suspend/hibernation functionality and for accessing soundcards, removable drives, cd/dvd-roms)
pacman -S --needed consolekit polkit-consolekit upower-pm-utils udisks2-nosystemd desktop-privileges xorg-xwrapper

pacman -S --needed polkit-gnome|polkit-kde|mate-polkit|lxsession|lxqt-policykit (also xfce-polkit-git or polkit-efl-git from the AUR)

usermod -a -G video,audio,power,disk,storage,optical,lp,scanner $USER
16 You can now reboot into openrc. However, since systemd's executables are no longer present, this is not possible at this point with the regular commands. Umount all filesystems manually and force remount / read-only. You can also use SysRq; sync filesystems, remount read-only and reboot. umount -a
mount -f / -o remount,ro
echo s >| /proc/sysrq-trigger
echo u >| /proc/sysrq-trigger
echo b >| /proc/sysrq-trigger
17 Enjoy your systemd-free box. Additional configuration may be needed, especially with regards to a window manager or a desktop environment. Read the information and the linked articles in Configuration for more information. OpenRC 0.13.8 is starting up Arch Linux (x86_64)

* Mounting /proc ... [ ok ]
* Mounting /run ...
* /run/openrc: creating directory
* /run/lock: creating directory
* /run/lock: correcting owner
* Caching service dependencies ...
...

About the pacman one-liner (or don't be too cocky)

You still want to do it in one step? Don't. It can be done, but I'll break it down in two. You see, as some packages depend on systemd, pacman will refuse to remove it if you simply 'pacman -S sysvinit openrc-core eudev'. The '-dd' switch is needed to convice pacman not to care about dependencies (effectively allowing systemd to be removed), but that will also instruct pacman not to fetch any dependencies for our newly installed openrc; it will only install the openrc packages explicitly specified in the command line and it's possible that we forget some important ones. I've forgotten sysvinit once... which of course resulted in unbootable system, whereas sysvinit would normally be pulled in as a dependency of openrc-core.
Therefore, the Correct(TM) approach is to remove systemd and family with '-Rdd' and let 'pacman -S' install openrc and family all-inclusive:

# pacman -Rdd systemd libsystemd systemd-sysvcompat # pacman -S sysvinit openrc-core eudev eudev-openrc eudev-systemdcompat dbus-nosystemd procps-ng-nosystemd syslog-ng-nosystemd udisks2-nosystemd consolekit polkit-consolekit upower-pm-utils udisks2-nosystemd desktop-privileges xorg-xwrapper acpid-openrc alsa-utils-openrc autofs-openrc consolekit consolekit-openrc cronie-openrc dbus-openrc cups-openrc displaymanager-openrc fuse-openrc haveged-openrc hdparm-openrc openssh-openrc samba-openrc syslog-ng-openrc avahi-openrc All you have to do now is to complete configuring your system as shown in the comprehensive steps above and in Configuration.

Revert to systemd

If, perchance, you're not satisfied with the result you can always roll-back to systemd by executing the above two pacman commands inverted.

# pacman -Rs sysvinit openrc-core eudev eudev-openrc eudev-systemdcompat dbus-nosystemd procps-ng-nosystemd syslog-ng-nosystemd udisks2-nosystemd consolekit polkit-consolekit upower-pm-utils udisks2-nosystemd desktop-privileges xorg-xwrapper acpid-openrc alsa-utils-openrc autofs-openrc consolekit consolekit-openrc cronie-openrc dbus-openrc cups-openrc displaymanager-openrc fuse-openrc haveged-openrc hdparm-openrc openssh-openrc samba-openrc syslog-ng-openrc avahi-openrc # pacman -S systemd libsystemd systemd-sysvcompat

But why would you want to do such a bad thing?