Configuring a system without elogind
Various programs require a certain environment in order to provide their functionality, including setting particular environment variables. In particular, some software requires 'seat management' in order to mediate access to hardware shared by multiple system users (e.g. the display, input devices) without needing root access.
On systemd-based systems, logind (systemd-logind.service(8)) is one of the programs used to set up the environment. On OpenRC-based systems, where logind isn't available, elogind (sys-auth/elogind, elogind(8)) can be used instead. However, some users might not wish to use elogind; this page describes the options available.
seatd
In some instances, seatd, provided by the sys-auth/seatd package, might be a suitable replacement for the seat-management functionality provided by elogind. Refer to the linked wiki page and the seatd(1) man page for further information.
Environment variables
An important environment variable configured by elogind is XDG_RUNTIME_DIR, described on the XDG/Base_Directories page:
[T]he base directory relative to which user-specific non-essential runtime files and other file objects (such as sockets, named pipes, ...) should be stored. The directory MUST be owned by the user, who MUST be the only one having read and write access to it; its permissions MUST be 0700.
If not set by elogind, this variable needs to be manually set via the appropriate shell configuration file, e.g. ~/.bash_login:
~/.bash_login
if test -z "${XDG_RUNTIME_DIR}"; then
export XDG_RUNTIME_DIR=$(mktemp -d "${UID}-runtime-dir.XXX")
fi
Other environment variables that might also need to be manually set include XDG_CACHE_HOME, XDG_CONFIG_HOME, XDG_DATA_HOME, and XDG_STATE_HOME:
~/.bash_login
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_STATE_HOME="${HOME}/.local/state"