Chapter 2. logind
logind
(or more specifically systemd-logind
) is a system service that manages user logins. This service is responsible for the following:
- keeping track of users and sessions, their processes and their idle states,
- creating control groups for user processes,
- providing PolicyKit-based access for users to operations such as system shutdown or sleep,
- implementing a shutdown/sleep inhibition logic for applications,
- handling of power/sleep hardware keys,
- multi-seat management, session switch management, and device access management for users,
- automatic spawning of text logins (gettys) on virtual terminal (console) activation and user runtime directory management.
The
logind
service is deeply integrated with systemd
, the new initialization system in Red Hat Enterprise Linux 7, and replaces the upstart
initialization system from Red Hat Enterprise Linux 6. With this change comes a number of new features and functions. The following is a summary of those most significant:
- ConsoleKit
- The
ConsoleKit
framework is deprecated in Red Hat Enterprise Linux 7. Equivalent functionality is now provided bysystemd
. BothConsoleKit
andlogind
are services for tracking the currently running user sessions.Note
ConsoleKit
had the ability to run arbitrary shell scripts any time the active session on the system changed (using virtual terminal switching). This functionality is no longer provided. - the /var/log/ConsoleKit/history file
- Previously,
ConsoleKit
was sending log files to/var/log/ConsoleKit/history
, which the presentlogind
does not support. The file has been replaced by the traditionalwtmp
andutmp
files which now keep track of all logins and logouts on the system./var/log/ConsoleKit/history
provided similar information as thewtmp
file, though in a different format. Given the overlap in functionality,logind
only adopted thewtmp
file's role. - seat.d scripts
- Since
ConsoleKit
is no longer in use,seat.d
scripts no longer complement theConsoleKit
framework, and have been replaced bysystemd-logind
. - the ck-list-sessions command
ConsoleKit
provided theck-list-sessions
command, which returned extended information about recent users, not only regular users but also GUI access withGDM
. The comparable result can now be reached by running theloginctl
command:$
loginctl list-sessions
- multi-seat support
logind
along withGDM
provide the multi-seat feature with which the user can attach another monitor, mouse, or keyboard to their machine. Doing so, an additional login screen appears and the user can log in as if they were using another machine.To list seats that are available on the system, run the following command:$
loginctl list-seats
To show the status of a specific seat on the system, run the following command:$
loginctl seat-status seat
where seat is the name of the seat, for exampleseat0
.To assign specific hardware to a particular seat, run the following command:#
loginctl attach seat device
where seat is the name of the seat, for exampleseat1
, and device is the device name specified with the/sys
device path, for example/sys/devices/pci0000:00/0000:00:02.0/drm/card0
.To change the assignment, assign the hardware to a different seat, or use theloginctl flush-devices
command.
Getting More Information
systemd-logind.service
(8) – The man page for logind
provides more information on the logind
usage and features. It also covers the APIs systemd-logind
provides (logind D-Bus API documentation).
logind.conf
(5) – The man page for logind.conf
discusses the login manager configuration file.
loginctl
(1) – The man page for the systemd
login manager includes more information on the multi-seat feature.