Manjaro Difference between revisions of "OpenRC, an alternative to systemd"

Difference between revisions of "OpenRC, an alternative to systemd"

From Manjaro
imported>Aaditya
 
imported>Aaditya
Line 1: Line 1:
#REDIRECT [[Using_OpenRC,_an_alternative_to_systemd]]
[http://www.gentoo.org/proj/en/base/openrc/ 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 [http://www.freedesktop.org/wiki/Software/systemd/ 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 [https://aur.archlinux.org/packages/?O=0&K=openrc 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 do '''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 [https://wiki.archlinux.org/index.php/LXDM LXDM]. However the version in the repos does not automatically start a ck-session on login; alternative [https://aur.archlinux.org/packages/lxdm-consolekit/ 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 [https://wiki.gentoo.org/wiki/ConsoleKit 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 [https://wiki.archlinux.org/index.php/Polkit 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 [[Using_OpenRC,_an_alternative_to_systemd#Troubleshooting | 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 [https://github.com/OpenRC/openrc/issues/17 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 [https://wiki.archlinux.org/index.php/Fstab#tmpfs Arch Wiki] for more details.
 
== Further Reading ==
 
[https://wiki.archlinux.org/index.php/Openrc The Arch Wiki]
 
[http://blog.notfoss.com/posts/openrc-on-arch-linux/ OpenRC on Arch Linux]
 
[http://abchk1234.wordpress.com/2014/06/03/using-openrc-on-arch-archbang-manjaro-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: [https://forum.manjaro.org/index.php?topic=14080.0]
 
 
[[Category:Contents Page]]

Revision as of 07:27, 9 June 2014

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 do 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.