Difference between pages "Desktop Environments and Window Managers" and "OpenRC, an alternative to systemd"

(Difference between pages)
imported>Excalibur1234
 
imported>Aaditya
 
Line 1: Line 1:
[https://wiki.gentoo.org/wiki/OpenRC OpenRC] is a dependency based [https://en.wikipedia.org/wiki/Init init] system maintained by the Gentoo developers, that works with the system provided init program, normally [http://savannah.nongnu.org/projects/sysvinit sysvinit]. It is not a replacement for sysvinit.


= General =
It is 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.
<div style="float: left; width: 50%">


* [[Install Desktop Environments|Install Desktop Environments and Window Managers]]
== Installation ==
:''Choose from a wide selection available in our repositories!''


OpenRC is available from the the Manjaro repositories. It can be installed as:


* [[Getting Window Managers to work properly]]
sudo pacman -S openrc-base
: ''An <u>absolute must</u> if installing Window Managers such as Openbox.''


The output of the above command looks like the following:


* [[Getting File Managers to work properly in Window Managers]]
$ sudo pacman -S openrc-base
: ''Details on ensuring full File Manager functionality and features.''
:: There are 10 members in group openrc-base:
</div>
:: 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]


<div style="float: right; width: 50%">
After installing the ''openrc-base'' package group, OpenRC should boot by default instead of systemd.
* [[Change the colours of your GTK+ themes]]
Note that it will boot to a command line, as the service for a graphical display manager has not yet been installed.
: ''Why settle for the colours provided for you?''


On installing ''openrc-base'', one may get messages like:


* [[Compiz_and_Emerald|Install Compiz Fusion and Emerald!]]
run 'rc-update add dbus default'
: ''Transform XFCE or KDE with fancy special effects!''
run 'rc-update add cronie default'
</div>
<div style="clear: both"></div>


Running these command(s) adds the service(s) to the specified runlevels. For example on running:


<!--Cinnamon Section -->
sudo rc-update add dbus default


[[File:Mint-debian-logo.png|left|45px]]
The dbus service would be added to the default runelevel and would automatically be started at boot.
= Cinnamon =
<br clear="all" />
<div style="float: left; width: 50%">


</div>
''dbus'' (system message bus) and ''cronie'' (for cron) are some common services that can be enabled.
=== Additional packages ===


<div style="float: right; width: 50%">
==== Display Manager ====


</div>
To boot to a graphical display manager, the '''displaymanager-openrc''' package can be installed.
<div style="clear: both"></div>


After installing it, the ''/etc/conf.d/xdm'' file needs to be edited to specify the display manager.


<!--Deepin Section -->
For example, to use '''lightdm''', change the line:


[[File:Deepin-logo-icon.jpg|left|45px]]
DISPLAYMANAGER="xdm"
= Deepin =
to
<br clear="all" />
DISPLAYMANAGER="lightdm"
<div style="float: left; width: 50%">


</div>
Finally the '''xdm''' service can be added to default runlevel:


<div style="float: right; width: 50%">
sudo rc-update add xdm default


</div>
'''Note:'''
<div style="clear: both"></div>


''lightdm'' and a ''lightdm-greeter'' (like ''lightdm-gtk-greeter'') should be installed to use lightdm as display manager. A guide is available on the [https://forum.manjaro.org/index.php?topic=21386.0 forums].


<!--E17 Section -->
An alternative to ''lightdm'' is [https://wiki.archlinux.org/index.php/LXDM LXDM]. However the version in the repository 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.


[[File:E17-logo.png|left|45px]]
For more information about consolekit, have a look at the [[Openrc#Consolekit | Consolekit]] section.
= E17 =
<br clear="all" />
<div style="float: left; width: 50%">


</div>
==== Audio (ALSA) ====


<div style="float: right; width: 50%">
The '''alsa-utils-openrc''' package can be installed. After installing it, run:


</div>
sudo rc-update add alsasound default
<div style="clear: both"></div>


to automatically start ''alsa'' at boot.


<!--Gnome Section -->
==== Network Manager ====


[[File:gnome-logo.png|left|45px]]
By default ''dhcpcd'' is enabled via [https://github.com/gentoo/netifrc netifrc]. However if one uses Wifi to connect to the internet, or need a graphical network applet, then '''networkmanager-openrc''' can be installed.
= Gnome =
<br clear="all" />
<div style="float: left; width: 50%">
* [[Remove XFCE and install GNOME 3]] '''<font color="green">(New!)</font>'''
: ''For those who don't want to start from the net edition.''
</div>


<div style="float: right; width: 50%">
''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.


</div>
Other alternatives like ''wicd-openrc'' and ''connman-openrc'' are also available.
<div style="clear: both"></div>


==== Consolekit ====


<!--KDE Section -->
The '''consolekit-openrc''' package can be installed. Consolekit supports multi-user setups, mounting of partitions by unauthorized users, etc. See the [https://wiki.gentoo.org/wiki/ConsoleKit Gentoo-Wiki] for more details.


[[File:kde-logo.jpg|left|45px]]
Consolekit also allows a normal (non-root) user to shutdown or restart the system if the desktop environment supports it.
= KDE =
<br clear="all" />
<div style="float: left; width: 50%">
* [[Remove XFCE and install KDE]]
: ''Because building the net edition just takes up too much time!''
</div>


<div style="float: right; width: 50%">
See the [[Openrc#Using_Consolekit | Using Consolekit]] section on how to install it and for more info.
* [[Enable preview files in Dolphin|Enable preview files in the Dolphin File Manager]]
: ''Preview those files like nobody's business!''
</div>


<div style="float: right; width: 50%">
==== openrc-desktop ====
* [[Enable properly working openGL 3.1 native animations in KWIN on Intel GPU (i915)|Enable properly working openGL 3.1 native animations in KWIN on Intel GPU (i915)]]
: ''Fix issue with openGL on Intel GPU.''


</div>
The ''openrc-desktop'' package group can be used to install most of the above desktop related packages in one go. For example:
<div style="clear: both"></div>


$ 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]


<!--LXDE Section -->
==== Others ====


[[File:lxde-logo.png|left|45px]]
===== ACPI =====


= LXDE =
For handling acpi events, '''acpid-openrc''' can be installed and enabled (see [https://wiki.archlinux.org/index.php/Acpid this] for more details on acpid).
<br clear="all" />
<div style="float: left; width: 50%">


</div>
===== Logging =====


<div style="float: right; width: 50%">
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.


</div>
===== Suspend/Hibernate =====
<div style="clear: both"></div>


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 [[Using_OpenRC,_an_alternative_to_systemd#Troubleshooting | troubleshooting]] section for some issues that one could face.


<!--LXQt Section -->
=== Note ===


[[File:lxqt-logo.png|left|45px]]
If using [[plymouth]] before, then {{ic|/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:
= LXQt =
<br clear="all" />
<div style="float: left; width: 50%">
* [[Minimal LXQt installation]] '''<font color="green">(New!)</font>'''
: ''A light-weight LXQT installation on top of Manjaro Net Edition''


HOOKS="base udev autodetect modconf block resume filesystems keyboard keymap fsck"


* [[HOW TO MAKE LXQt PURER (LIKE KDE) AND LEANER WITHOUT GTK]]
After that would need to regenerate the initrd as:
: ''How to remove all GTK2 and GTK3 dependencies from LXQt''


sudo mkinitcpio -p linux<version>


* [[LXQt with kwin]] '''<font color="green">(New!)</font>'''
For example,
: ''How to use kwin instead of openbox as window manager''
</div>


<div style="float: right; width: 50%">
sudo mkinitcpio -p linux314
* [[THEMING]] '''<font color="green">(Improved!)</font>'''
: ''How to change themes and icons in LXQt''


== Configuration ==


* [[CUSTOM ACTIONS FOR PCmanFM-Qt]]
=== Adding or Removing services ===
: ''Edit the right click menu in the LXQt file browser''


Services can be added to startup with:


* [[GLOBAL SHORTCUTKEYS FOR AUDIO (MPD/CANTATA)]]
sudo rc-update add <service> <runlevel>
: ''Keyboard shortcuts for your music player''
</div>


<div style="clear: both"></div>
For example,


sudo rc-update add sshd default


<!--MATE Section -->
runlevel can be skipped if adding services to the current runlevel, ie:


[[File:mate-logo.png|left|45px]]
sudo rc-update add sshd


= MATE =
A service can be removed from startup with:
<br clear="all" />
<div style="float: left; width: 50%">
* [[MATE Desktop Environment|Install MATE and the Mint Menu]]
: ''A desktop not officially supported or provided by the Manjaro Repositories. Install it anyway!''


</div>
sudo rc-update del <service> <runlevel>


<div style="float: right; width: 50%">
=== Check running services ===


</div>
To check what services are running, one can type:
<div style="clear: both"></div>


rc-status


<!--Openbox Section -->
=== Start / stop / restart services ===


[[File:openbox-logo.png|left|55px]]
To start / stop / restart services ''immediately'', the '''rc-service''' command can be used. For example:
= Openbox =
<br clear="all" />
<div style="float: left; width: 50%">
* [[Openbox Dock with the Lal Clock & Trayer|Openbox: Dock with the Lal Clock & Trayer]]
: ''Without a panel, is it enough? ''


sudo rc-service networkmanager restart


* [[Openbox: Control Screen Brightness Using the Keyboard]]
=== Some common services ===
: ''Control illumination by using the appropriate brightness keys!''


To enable printing support, the '''cups-openrc''' package can be installed. For example,


* [[Openbox: Control Speaker Volume Using the Keyboard (ALSA)]]
$ sudo pacman -S cups-openrc
: ''Control or mute the volume by using the appropriate volume keys!''
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]


</div>
The service for it is ''cupsd''.


<div style="float: right; width: 50%">
$ sudo rc-service cupsd start
* [[Openbox: ob-autostart - a simple GUI for auto-starting files in Openbox:]]
* Starting cupsd ...                                                                                                      [ ok ]
: ''GUI for managing Openbox autostart files.''


For ssh, the '''openssh-openrc''' package can be installed.


* [[Openbox: Switch languages using the keyboard and xxkb]]
The service for it is named ''sshd''.
: ''Analytical instructions for changing keyboard languages and layouts (in both the console and X11), using a keyboard shortcut and XXkb with country flag images.''


{{Tip | All services present can be listed with the '''{{ic|rc-service --list}}''' command.}}


* [[Auto-Login without a Graphical Desktop Manager & with Systemd]]
== Using Consolekit (deprecated) ==
: ''For those that want to boot straight into Openbox without going through a Desktop Manager or having to login.''


</div>
{{Warning | Consolekit has been depricated in Manjaro in favour of [https://forum.manjaro.org/t/switch-from-consolekit-to-elogind/19412 elogind]}}
<div style="clear: both"></div>




<!--Pekwm Section -->
Additionally, if not already done, [https://wiki.gentoo.org/wiki/ConsoleKit consolekit] can be installed to perform root actions like shutting down or restarting system as non-root user from your Desktop Environment.


[[File:Pekwm logo.png|left|45px]]
Consolekit can be installed in the following way:
= PeK =
<br clear="all" />
<div style="float: left; width: 50%">


</div>
sudo pacman -S consolekit-openrc polkit-consolekit cgmanager-openrc


<div style="float: right; width: 50%">
The output looks like the following:


</div>
$ sudo pacman -S consolekit-openrc polkit-consolekit cgmanager-openrc
<div style="clear: both"></div>
resolving dependencies...
looking for inter-conflicts...
:: 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
              consolekit-openrc-20150911-1  polkit-consolekit-0.113-1
Total Download Size:    0.92 MiB
Total Installed Size:  4.44 MiB
Net Upgrade Size:      2.84 MiB
:: Proceed with installation? [Y/n]


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:
ck-list-sessions


<!--XFCE Section -->
The output looks like the following:


[[File:XFCE-logo.png|left|45px]]
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 = ''


= XFCE =
If you are not getting any output, then maybe a ck-session is not being started by your display manager.
<br clear="all" />
<div style="float: left; width: 50%">
* [[XFCE:Making Keyboard Shortcuts for Frequently Used Applications|Making Keyboard Shortcuts for Frequently Used Applications]]
: ''Become a keyboard ninja to speed things up!''


To start a ck-session and X session from the command line following syntax could be used:


* [[Open URL's in Thunderbird in favorite browser in XFCE]]
ck-launch-session <session-name>
: ''Because obviously you wouldn't want to do this in another environment!''


</div>
For example,


<div style="float: right; width: 50%">* [[Volume Stuck on Mute (XFCE Desktop)]]
ck-launch-session startxfce4
: ''Two possible solutions for an issue that affects some users of the XFCE desktop environment.''


=== Some gotcha's ===


* [[Improve Font Rendering]]
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.
: ''A way to optimise font rendering.''


</div>
If you start a graphical session from the command line, [http://bbs.archbang.org/viewtopic.php?pid=1394#p1394 this forum post] may be of some help.
<div style="clear: both"></div>
 
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 ==
 
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.
 
[http://www.gentoo.org/proj/en/eudev/ 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 eudev-systemdcompat
 
The output looks like the following:
 
$ sudo pacman -S eudev eudev-systemdcompat
resolving dependencies...
looking for conflicting packages...
:: eudev and libsystemd are in conflict (libgudev-1.0.so). Remove libsystemd? [y/N] y
:: eudev-systemdcompat and systemd are in conflict. Remove systemd? [y/N] y
warning: dependency cycle detected:
warning: eudev-systemdcompat will be installed before its eudev dependency
Packages (4) libsystemd-219-6 [removal]  systemd-219-6 [removal]  eudev-3.0-1  eudev-systemdcompat-219-2
Total Download Size:    0.95 MiB
Total Installed Size:    7.09 MiB
Net Upgrade Size:      -18.78 MiB
:: Proceed with installation? [Y/n]
 
After the above steps systemd would be uninstalled and replaced by eudev and its counterparts.
 
=== Note ===
 
''eudev-systemdcompat'' has been superseded by ''eudev-systemd'' and ''libeudev-systemd'' [https://forum.manjaro.org/t/update-troubles/9046 (link)].
 
== Troubleshooting ==
 
=== Boot logs ===
 
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
 
=== Using tmpfs ===
 
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 [https://wiki.archlinux.org/index.php/Fstab#tmpfs Arch Wiki] for more details.
 
=== 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:
 
# You should consult your kernel documentation and configuration
# for a list of modules and their options.
modules="vboxdrv"
 
=== 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''
 
=== Setting keymap ===
 
The keymap for the console can be set via editing {{ic|/etc/conf.d/keymaps}}.
 
For X11 (graphical part of the system), it can be set via {{ic|/etc/X11/xorg.conf.d/20-keyboard.conf}}
 
For more information have a look at the [http://wiki.gentoo.org/index.php?title=Keyboard_layout_switching Gentoo wiki] (with the difference that in Arch/Manjaro the keymaps are stored in ''/usr/share/kbd/keymaps'' [https://wiki.archlinux.org/index.php/Keymap]).
 
=== Setting Hardware clock ===
 
Can be done by editing {{ic|/etc/conf.d/hwclock}}
 
=== Shutting down / rebooting ===
 
To shutdown the system, the {{ic|'''poweroff'''}} command can be used.
 
Similarly to reboot, the {{ic|'''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 [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:
 
# Xorg.wrap configuation file
needs_root_rights = yes
 
Reference: [https://bbs.archlinux.org/viewtopic.php?pid=1441150#p1441150 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
 
Reference: https://github.com/gentoo/eudev/issues/107
 
=== MySQL service not working ===
 
Have a look here: https://forum.manjaro.org/t/mariadb-daemon-dont-start-in-openrc/20356
 
=== Pulseaudio does not start / work ===
 
See: https://forum.manjaro.org/t/pulseaudio-and-openrc/5881/1
 
=== Ctrl + Alt + Backspace causes problems with some display managers ===
 
Have a look here: https://forum.manjaro.org/t/ctrl-alt-backspace-doesnt-log-out-zaps-xorg-openrc
 
=== Httpd (Apache) service status says crashed ===
 
If the {{ic|httpd}} process is running but {{ic|rc-status}} shows the service as crashed, try editing ''/etc/init.d/httpd'' and remove the {{ic|start-stop-daemon}} call when starting the service:
 
  # sed 's|start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start|${APACHE2} ${APACHE2_OPTS} -k start|' -i /etc/init.d/httpd
 
Forum link: https://forum.manjaro.org/t/solved-apache-service-httpd-status-status-crashed/19878
 
=== Unable to build ISO using manjaro-tools on OpenRC ===
 
See https://forum.manjaro.org/t/manjaro-tools-14-on-testing-openrc/17156
 
== 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.manjaro.org/index.php?title=Autostart_X_at_Login_-_OpenRC_%26_SystemD Autostart X at Login - OpenRC]
 
[http://systemd-free.org/ systemd-free.org]
 
[https://wiki.gentoo.org/wiki/Handbook:X86/Working/Initscripts Initscripts]
 
[https://wiki.gentoo.org/wiki//etc/local.d /etc/local.d]
 
== Support ==
 
Following is a link where you can post any related feedback: [https://forum.manjaro.org/c/technical-issues-and-assistance/openrc]
 
 
[[Category:Contents Page]]
Anonymous user