OpenRC, an alternative to systemd
It is 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.
- 1 Installation
- 2 Configuration
- 3 Using Consolekit
- 4 Replacing systemd with eudev (advanced users)
- 5 Troubleshooting
- 5.1 Boot logs
- 5.2 Get warning at shutdown
- 5.3 Error about /etc/sysctl.conf not found
- 5.4 Enable Swap (for GPT partitions)
- 5.5 Using tmpfs
- 5.6 Module auto-loading
- 5.7 Setting hostname
- 5.8 Setting keymap
- 5.9 Setting Hardware clock
- 5.10 Shutting down / rebooting
- 5.11 X does not start from a virtual terminal
- 5.12 Input devices not working
- 5.13 MySQL service not working
- 6 Further Reading
- 7 Support
OpenRC is available from the the Manjaro repositories. It can be installed as:
sudo pacman -S openrc-base
The output of the above command looks like the following:
$ sudo pacman -S openrc-base :: There are 10 members in group openrc-base: :: Repository community 1) cronie-openrc 2) cryptsetup-openrc 3) dbus-openrc 4) device-mapper-openrc 5) dhcpcd-openrc 6) glibc-openrc 7) inetutils-openrc 8) lvm2-openrc 9) mdadm-openrc 10) openrc-core Enter a selection (default=all): resolving dependencies... looking for inter-conflicts... :: openrc-core and systemd-sysvcompat are in conflict. Remove systemd-sysvcompat? [y/N] y Packages (12): systemd-sysvcompat-212-3 [removal] sysvinit-2.88-15 cronie-openrc-20140614-1 cryptsetup-openrc-20140614-1 dbus-openrc-20140614-1 device-mapper-openrc-20140614-1 dhcpcd-openrc-20140614-1 glibc-openrc-20140614-1 inetutils-openrc-20140614-1 lvm2-openrc-20140614-1 mdadm-openrc-20140614-1 openrc-core-0.12.4-16 Total Download Size: 0.22 MiB Total Installed Size: 1.19 MiB :: Proceed with installation? [Y/n]
After installing the openrc-base package group, 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 openrc-base, one may get messages like:
run 'rc-update add dbus default' run 'rc-update add cronie default'
Running these command(s) adds the service(s) to the specified runlevels. For example on running:
sudo rc-update add dbus default
The dbus service would be added to the default runelevel and would automatically be started at boot.
dbus (system message bus) and cronie (for cron) are some common services that can be enabled.
To boot to a graphical display manager, the displaymanager-openrc package can be installed.
After installing it, the /etc/conf.d/xdm file needs to be edited to specify the display manager.
For example, to use lightdm, change the line:
Finally the xdm service can be added to default runlevel:
sudo rc-update add xdm default
lightdm and a lightdm-greeter (like lightdm-gtk-greeter) should be installed to use lightdm as display manager. A guide is available on the forums.
For more information about consolekit, have a look at the Consolekit section.
The alsa-utils-openrc package can be installed. After installing it, run:
sudo rc-update add alsasound default
to automatically start alsa at boot.
By default dhcpcd is enabled via netifrc. However if one uses Wifi to connect to the internet, or need a graphical network applet, then networkmanager-openrc can be installed.
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.
Other alternatives like wicd-openrc and connman-openrc are also available.
The consolekit-openrc package can be installed. Consolekit supports multi-user setups, mounting of partitions by unauthorized users, etc. See the Gentoo-Wiki for more details.
Consolekit also allows a normal (non-root) user to shutdown or restart the system if the desktop environment supports it.
See the Using Consolekit section on how to install it and for more info.
The openrc-desktop package group can be used to install most of the above desktop related packages in one go. For example:
$ sudo pacman -S openrc-desktop :: There are 6 members in group openrc-desktop: :: Repository community 1) acpid-openrc 2) alsa-utils-openrc 3) avahi-openrc 4) consolekit-openrc 5) displaymanager-openrc 6) gpm-openrc Enter a selection (default=all): resolving dependencies... looking for inter-conflicts... Packages (6): acpid-openrc-20140614-1 alsa-utils-openrc-20140614-1 avahi-openrc-20140614-1 consolekit-openrc-20140614-1 displaymanager-openrc-20140614-1 gpm-openrc-20140614-1 Total Installed Size: 0.12 MiB Net Upgrade Size: 0.00 MiB :: Proceed with installation? [Y/n]
For handling acpi events, acpid-openrc can be installed and enabled (see this for more details on acpid).
For logging, a logger can be chosen from metalog-openrc, syslog-ng-openrc, and rsyslog-openrc, by installing the package and enabling its respective service.
To suspend and hibernate via the command line, pm-utils can be installed. You may also need the upower-pm-utils package if suspend and hibernate does not work. See the troubleshooting section for some issues that one could face.
If using plymouth before, then
/etc/mkinitcpio.conf would need to be edited to remove the plymouth hook, as plymouth does not work correctly with OpenRC. The hooks line should look like:
HOOKS="base udev autodetect modconf block resume filesystems keyboard keymap fsck"
After that would need to regenerate the initrd as:
sudo mkinitcpio -p linux<version>
sudo mkinitcpio -p linux314
Adding or Removing services
Services can be added to startup with:
sudo rc-update add <service>
A service can be removed from startup with:
sudo rc-update del <service>
Check running services
To check what services are running, one can type:
Start / stop / restart services
To start / stop / restart services immediately, the rc-service command can be used. For example:
sudo rc-service networkmanager restart
Some common services
To enable printing support, the cups-openrc package can be installed. For example,
$ sudo pacman -S cups-openrc resolving dependencies... looking for inter-conflicts... Packages (1): cups-openrc-20141014-1 Total Installed Size: 0.01 MiB Net Upgrade Size: 0.00 MiB :: Proceed with installation? [Y/n]
The service for it is cupsd.
$ sudo rc-service cupsd start * Starting cupsd ... [ ok ]
For ssh, the openssh-openrc package can be installed.
The service for it is named sshd.
Additionally, if not already done, consolekit can be installed to perform root actions like shutting down or restarting system as non-root user from your Desktop Environment.
Consolekit can be installed in the following way:
sudo pacman -S consolekit-openrc
The output looks like the following:
$ sudo pacman -S consolekit-openrc [sudo] password for aaditya: resolving dependencies... looking for inter-conflicts... :: polkit-consolekit and polkit are in conflict. Remove polkit? [y/N] y Packages (5): consolekit-0.4.6-4 js185-1.0.0-2 polkit-0.112-2 [removal] polkit-consolekit-0.112-2 consolekit-openrc-20140614-1 Total Download Size: 1.90 MiB Total Installed Size: 10.67 MiB Net Upgrade Size: 9.08 MiB :: Proceed with installation? [Y/n]
After installing it can be enabled with
sudo rc-update add consolekit and would be activated after a reboot.
To check that consolekit is running and a ck-session was started, the following command can be used:
The output looks like the following:
Session1: unix-user = '1000' realname = 'Aaditya Bagga' seat = 'Seat1' session-type = active = TRUE x11-display = ':0' x11-display-device = '/dev/tty7' display-device = remote-host-name = is-local = TRUE on-since = '2014-06-15T13:29:58.652929Z' login-session-id =
If you are not getting any output, then maybe a ck-session is not being started by your display manager.
To start a ck-session and X session from the command line following syntax could be used:
Display managers that are known to work with consolekit are lightdm, lxdm (via lxdm-consolekit), kdm (via kdebase-workspace-consolekit), and mdm (via mdm-nosystemd). Have a look at the Display Manager section for more info.
If you start a graphical session from the command line, this forum post may be of some help.
Replacing systemd with eudev (advanced users)
With OpenRC being used as init system, the role of systemd is reduced to that of a udev provider, and for compatibility reasons.
eudev, developed by the Gentoo folks, can be used as replacement. Note that removing systemd could cause some incompatibilities with existing software.
The steps to install eudev are as follows:
sudo pacman -S eudev-openrc eudev-systemdcompat
The output looks like the following:
$ sudo pacman -S eudev-openrc eudev-systemdcompat resolving dependencies... looking for inter-conflicts... :: eudev-systemdcompat and systemd are in conflict. Remove systemd? [y/N] y :: eudev-systemdcompat and libsystemd are in conflict. Remove libsystemd? [y/N] y Packages (6): eudev-1.9-1 libeudev-1.9-1 libsystemd-212-2 [removal] systemd-212-2 [removal] eudev-openrc-20140712-1 eudev-systemdcompat-215-1 Total Download Size: 0.93 MiB Total Installed Size: 6.38 MiB Net Upgrade Size: -10.84 MiB :: Proceed with installation? [Y/n]
After the above steps systemd would be uninstalled and replaced by eudev and its counterparts.
Note the optional dependencies for eudev:
Optional dependencies for eudev upower-pm-utils: pm-utils support
The upower-pm-utils package can be installed in order to be able to suspend and hibernate the system.
After uninstalling systemd, I could not login to my xfce4-session, as it was complied for systemd. Hence I had to install xfce4-session-consolekit from the AUR to get it working. I also had to recompile xfce4-power-manager against upower-pm-utils to get it working (available in the AUR as xfce4-power-manager-upower).
Some packages depend on systemd components like systemd-tmpfiles and systemd-sysusers in their post install tasks; the openrc-systemdcompat package from the AUR can be installed to compensate for these missing components.
The boot logs for OpenRC are stored in /var/log/rc.log
Get warning at shutdown
If at shutdown there is a message like:
WARNING: /usr/lib/rc/cache is not writable!
Then this directory can be created as:
sudo mkdir /usr/lib/rc/cache
Error about /etc/sysctl.conf not found
It can be created with:
sudo touch /etc/sysctl.conf
Enable Swap (for GPT partitions)
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
systemd used to set a tmpfs by default; to set it manually via /etc/fstab, the following lines can be added:
tmpfs /tmp tmpfs nodev,nosuid 0 0
See the Arch Wiki for more details.
For OpenRC, the modules to be loaded at boot are specified in /etc/conf.d/modules rather than being present as individual files in /etc/modules-load.d
The required modules can be manually moved over. An example /etc/conf.d/modules file looks like the following:
# You should consult your kernel documentation and configuration # for a list of modules and their options. modules="vboxdrv"
If your hostname is being displayed as localhost even if there a different hostname in /etc/hostname, then you probably need to change your hostname in /etc/conf.d/hostname
The keymap for the console can be set via editing
For X11 (graphical part of the system), it can be set via
Setting Hardware clock
Can be done by editing
Shutting down / rebooting
To shutdown the system, the
poweroff command can be used.
Similarly to reboot, the
reboot command can be used.
X does not start from a virtual terminal
With Xorg-1.16, Arch Linux decided to make X rootless using systemd-logind .
This means that using
startx from a virtual terminal will possibly not work for users of OpenRC init system.
The workaround is to create a file
/etc/X11/Xwrapper.config with the contents:
# Xorg.wrap configuation file needs_root_rights = yes
Reference: Arch forum
Input devices not working
With eudev-3.0, a new input group was introduced; you could try adding your user to it.
sudo gpasswd -a <user> input
MySQL service not working
Following is a link to this page's forum counterpart where you can post any related feedback: