elogind is the systemd project's logind, extracted to a standalone package. It's designed for users who prefer a non-systemd init system, but still want to use popular software such as KDE/Wayland or GNOME that otherwise hard-depends on systemd.
The following kernel options are recommended:
General setup ---> [*] Control Group support ---> File systems ---> [*] Inotify support for userspace
In the unlikely (and not recommended) event that standard kernel features are enabled for manual configuration, elogind also requires
timerfd() support. Most users can ignore this.
USE flags for sys-auth/elogind The systemd project's logind, extracted to a standalone package
||Add support for Access Control Lists|
||Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces|
||Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally|
||Add support for PAM (Pluggable Authentication Modules)DANGEROUS to arbitrarily flip|
||Enable PolicyKit authentication support|
||!!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur|
There is a global
elogind USE flag for enabling elogind support in other packages. It's also recommended to disable support for other session trackers to avoid conflicts:
USE="elogind -consolekit -systemd"
Running more than one session tracker at the same time may lead to unforeseen problems with some applications.
After updating your USE flags update the system so the changes take effect:
emerge --ask --changed-use --deep @world
elogind may be optionally configured to start at boot time:
rc-update add elogind boot
Alternatively, elogind will be launched automatically when the first service calls it via dbus, or if built with
USE="pam", when the first user logs into the system. However if there are problems getting poweroff/reboot/suspend etc. working from desktop environment, putting elogind into boot runlevel will make sure it is started properly before any user is logged in and so should fix the problem.
To have an elogind session created when using startx to start the X server (instead of a display manager), add the following to the user's ~/.xinitrc file:
exec dbus-launch --exit-with-session <WINDOW_MANAGER>
WINDOW_MANAGER in the above example needs to be replaced by a window manager or a single application.
Hook scripts to be run when suspending/hibernating and/or when resuming/thawing
Prior to employing elogind, Gentoo used Consolekit and if you wanted to use hook scripts, you could enable the pm-utils use flag. However, with elogind the situation is much handier. Any suspend/resume and hibernate/thaw hook scripts need to be in the directory /lib64/elogind/system-sleep/ and use the variables $1 ('pre' or 'post') and $2 ('suspend', 'hibernate', or 'hybrid-sleep'). For example, in the case of elogind a hook script could have the following format:
#!/bin/bash case $1/$2 in pre/*) # Put here any commands you want to be run when suspending or hibernating. ;; post/*) # Put here any commands you want to be run when resuming from suspension or thawing from hibernation. ;; esac
Do not forget to make your hook scripts executable.
The command loginctl may be used to control and introspect the login manager. For example, to shut down or reboot the system:
For example, to suspend, hibernate or hybrid-suspend the system:
Conflict when using hidepid in proc
When procfs is mounted with hidepid=2 and gid=wheel, there will be conflicts with elogind. In order to change this, the gid needs to be changed to gid=polkitd.
See also this forum post https://forums.gentoo.org/viewtopic-t-1099870.html
- bug #599470 - sys-auth/elogind integration into Gentoo tracker bug.
- News item - Desktop profile switching USE default to elogind