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

m
small layout adjustments
imported>Fhdk
m (changed forum link to point to archived forum)
imported>Fhdk
m (small layout adjustments)
Line 1: Line 1:
__TOC__
{{Important|Manjaro does no longer support OpenRC}}
{{Important|Manjaro does no longer support OpenRC}}
{{Important|If you are looking for OpenRC capable Arch have a look at [https://artixlinux.org Artix Linux]}}
{{Important|If you are looking for OpenRC capable Arch have a look at [https://artixlinux.org Artix Linux]}}
Line 85: Line 87:
==== openrc-desktop ====
==== openrc-desktop ====
The ''openrc-desktop'' package group can be used to install most of the above desktop related packages in one go. For example:
The ''openrc-desktop'' package group can be used to install most of the above desktop related packages in one go. For example:
<pre>
  $ sudo pacman -S openrc-desktop
  $ sudo pacman -S openrc-desktop
  :: There are 6 members in group openrc-desktop:
  :: There are 6 members in group openrc-desktop:
Line 103: Line 106:
   
   
  :: Proceed with installation? [Y/n]  
  :: Proceed with installation? [Y/n]  
 
</pre>
==== Others ====
==== Others ====
===== ACPI =====
===== ACPI =====
Line 138: Line 141:
=== Some common services ===
=== Some common services ===
To enable printing support, the '''cups-openrc''' package can be installed. For example,
To enable printing support, the '''cups-openrc''' package can be installed. For example,
<pre>
  $ sudo pacman -S cups-openrc
  $ sudo pacman -S cups-openrc
  resolving dependencies...
  resolving dependencies...
Line 148: Line 152:
   
   
  :: Proceed with installation? [Y/n]  
  :: Proceed with installation? [Y/n]  
</pre>
The service for it is ''cupsd''.
The service for it is ''cupsd''.
  $ sudo rc-service cupsd start
  $ sudo rc-service cupsd start
Line 161: Line 166:


The output looks like the following:
The output looks like the following:
<pre>
  $ sudo pacman -S consolekit-openrc polkit-consolekit cgmanager-openrc
  $ sudo pacman -S consolekit-openrc polkit-consolekit cgmanager-openrc
  resolving dependencies...
  resolving dependencies...
Line 166: Line 172:
  :: polkit-consolekit and polkit are in conflict. Remove polkit? [y/N] y
  :: polkit-consolekit and polkit are in conflict. Remove polkit? [y/N] y
   
   
  Packages (9): cgmanager-0.37-2  consolekit-1.0.0-3  libnih-1.0.3-2 openrc-core-0.17-2  polkit-0.112-2 [removal] cgmanager-openrc-20150911-1
  Packages (9): cgmanager-0.37-2  consolekit-1.0.0-3  libnih-1.0.3-2  
              consolekit-openrc-20150911-1  polkit-consolekit-0.113-1
              openrc-core-0.17-2  polkit-0.112-2 [removal]  
              cgmanager-openrc-20150911-1 consolekit-openrc-20150911-1   
              polkit-consolekit-0.113-1
   
   
  Total Download Size:    0.92 MiB
  Total Download Size:    0.92 MiB
Line 174: Line 182:
   
   
  :: Proceed with installation? [Y/n]  
  :: Proceed with installation? [Y/n]  
 
</pre>
After installing it can be enabled with {{ic|'''sudo rc-update add consolekit'''}} and would be activated after a reboot.
After installing it can be enabled with {{ic|'''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:
To check that consolekit is running and a ck-session was started, the following command can be used:
  ck-list-sessions
  ck-list-sessions
The output looks like the following:
The output looks like the following:
</pre>
  Session1:
  Session1:
  unix-user = '1000'
  unix-user = '1000'
Line 192: Line 201:
  on-since = '2014-06-15T13:29:58.652929Z'
  on-since = '2014-06-15T13:29:58.652929Z'
  login-session-id = ''
  login-session-id = ''
 
</pre>
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:
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:
  ck-launch-session <session-name>
  ck-launch-session <session-name>
For example,
For example,
  ck-launch-session startxfce4
  ck-launch-session startxfce4
=== Some gotcha's ===
=== Some gotcha's ===
Display managers that are known to work with consolekit are '''lightdm''', '''lxdm''' (via [https://aur.archlinux.org/packages/lxdm-consolekit/ lxdm-consolekit]), '''kdm''' (via [https://aur.archlinux.org/packages/kdebase-workspace-consolekit/ kdebase-workspace-consolekit]), and '''mdm''' (via [https://aur.archlinux.org/packages/mdm-nosystemd/ mdm-nosystemd]). Have a look at the [[Openrc#Display_Manager | Display Manager]] section for more info.
Display managers that are known to work with consolekit are '''lightdm''', '''lxdm''' (via [https://aur.archlinux.org/packages/lxdm-consolekit/ lxdm-consolekit]), '''kdm''' (via [https://aur.archlinux.org/packages/kdebase-workspace-consolekit/ kdebase-workspace-consolekit]), and '''mdm''' (via [https://aur.archlinux.org/packages/mdm-nosystemd/ mdm-nosystemd]). Have a look at the [[Openrc#Display_Manager | Display Manager]] section for more info.
Line 203: Line 214:


If you use Openbox or another Window Manager along with [https://wiki.archlinux.org/index.php/Oblogout oblogout], then [https://aur.archlinux.org/packages/oblogout-consolekit/ oblogout-consolekit] from the AUR can be used for having a graphical logout interface.
If you use Openbox or another Window Manager along with [https://wiki.archlinux.org/index.php/Oblogout oblogout], then [https://aur.archlinux.org/packages/oblogout-consolekit/ oblogout-consolekit] from the AUR can be used for having a graphical logout interface.
== Replacing systemd with eudev ==
== Replacing systemd with eudev ==
With OpenRC being used as init system, the role of systemd is reduced to that of a [https://wiki.archlinux.org/index.php/Udev udev] provider, and for compatibility reasons.
With OpenRC being used as init system, the role of systemd is reduced to that of a [https://wiki.archlinux.org/index.php/Udev udev] provider, and for compatibility reasons.
Line 212: Line 224:


The output looks like the following:
The output looks like the following:
<pre>
  $ sudo pacman -S eudev eudev-systemdcompat
  $ sudo pacman -S eudev eudev-systemdcompat
  resolving dependencies...
  resolving dependencies...
Line 227: Line 240:
   
   
  :: Proceed with installation? [Y/n]  
  :: Proceed with installation? [Y/n]  
</pre>
After the above steps systemd would be uninstalled and replaced by eudev and its counterparts.


After the above steps systemd would be uninstalled and replaced by eudev and its counterparts.
=== Note ===
=== Note ===
''eudev-systemdcompat'' has been superseded by ''eudev-systemd'' and ''libeudev-systemd'' [https://forum.manjaro.org/t/update-troubles/9046 (link)].
''eudev-systemdcompat'' has been superseded by ''eudev-systemd'' and ''libeudev-systemd'' [https://forum.manjaro.org/t/update-troubles/9046 (link)].
== Troubleshooting ==
== Troubleshooting ==
=== Boot logs ===
=== Boot logs ===
The boot logs for OpenRC are stored in ''/var/log/rc.log''
The boot logs for OpenRC are stored in ''/var/log/rc.log''
=== Get warning at shutdown ===
=== Get warning at shutdown ===
If at shutdown there is a message like:
If at shutdown there is a message like: ''WARNING: /usr/lib/rc/cache is not writable!''
WARNING: /usr/lib/rc/cache is not writable!
 
Then this directory can be created as:
Then this directory can be created as:
  sudo mkdir /usr/lib/rc/cache
  sudo mkdir /usr/lib/rc/cache
Line 246: Line 262:
=== Enable Swap (for GPT partitions) ===
=== 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. The following entry may be added to ''/etc/fstab''
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. The following entry may be added to ''/etc/fstab''
<pre>
  # /dev/sdyX
  # /dev/sdyX
  UUID=xxxx-yyyy.zzzz-xxxx swap swap sw 0 0
  UUID=xxxx-yyyy.zzzz-xxxx swap swap sw 0 0
 
</pre>
=== Using tmpfs ===
=== Using tmpfs ===
systemd used to set a ''tmpfs'' by default; to set it manually via ''/etc/fstab'', the following lines can be added:
systemd used to set a ''tmpfs'' by default; to set it manually via ''/etc/fstab'', the following lines can be added:
<pre>
  tmpfs /tmp tmpfs  nodev,nosuid          0  0
  tmpfs /tmp tmpfs  nodev,nosuid          0  0
</pre>
See the [https://wiki.archlinux.org/index.php/Fstab#tmpfs Arch Wiki] for more details.


See the [https://wiki.archlinux.org/index.php/Fstab#tmpfs Arch Wiki] for more details.
=== Module auto-loading ===
=== Module auto-loading ===
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:
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:
<pre>
  # You should consult your kernel documentation and configuration
  # You should consult your kernel documentation and configuration
  # for a list of modules and their options.
  # for a list of modules and their options.
  modules="vboxdrv"
  modules="vboxdrv"
 
<pre>
=== Setting hostname ===
=== Setting hostname ===
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''
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''
Line 275: Line 295:
With Xorg-1.16, Arch Linux decided to make X rootless using systemd-logind [https://www.archlinux.org/news/xorg-server-116-is-now-available/].
With Xorg-1.16, Arch Linux decided to make X rootless using systemd-logind [https://www.archlinux.org/news/xorg-server-116-is-now-available/].
This means that using {{ic|startx}} from a virtual terminal will possibly not work for users of OpenRC init system. The workaround is to create a file {{ic|/etc/X11/Xwrapper.config}} with the contents:
This means that using {{ic|startx}} from a virtual terminal will possibly not work for users of OpenRC init system. The workaround is to create a file {{ic|/etc/X11/Xwrapper.config}} with the contents:
<pre>
  # Xorg.wrap configuation file
  # Xorg.wrap configuation file
  needs_root_rights = yes
  needs_root_rights = yes
 
</pre>
Reference: [https://bbs.archlinux.org/viewtopic.php?pid=1441150#p1441150 Arch forum]
Reference: [https://bbs.archlinux.org/viewtopic.php?pid=1441150#p1441150 Arch forum]


Line 310: Line 331:


== Further Reading ==
== 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]
* [https://wiki.archlinux.org/index.php/Openrc The Arch Wiki]
[https://wiki.manjaro.org/index.php?title=Autostart_X_at_Login_-_OpenRC_%26_SystemD Autostart X at Login - OpenRC]
* [http://blog.notfoss.com/posts/openrc-on-arch-linux/ OpenRC on Arch Linux]
[http://systemd-free.org/ systemd-free.org]
* [https://wiki.manjaro.org/index.php?title=Autostart_X_at_Login_-_OpenRC_%26_SystemD Autostart X at Login - OpenRC]
[https://wiki.gentoo.org/wiki/Handbook:X86/Working/Initscripts Initscripts]
* [http://systemd-free.org/ systemd-free.org]
[https://wiki.gentoo.org/wiki//etc/local.d /etc/local.d]
* [https://wiki.gentoo.org/wiki/Handbook:X86/Working/Initscripts Initscripts]
* [https://wiki.gentoo.org/wiki//etc/local.d /etc/local.d]




[[Category:Obsolete]]
[[Category:Obsolete]]
Anonymous user