Ce contenu n'est pas disponible dans la langue sélectionnée.
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
ConsoleKitframework is deprecated in Red Hat Enterprise Linux 7. Equivalent functionality is now provided bysystemd. BothConsoleKitandlogindare services for tracking the currently running user sessions.Note
ConsoleKithad 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,
ConsoleKitwas sending log files to/var/log/ConsoleKit/history, which the presentloginddoes not support. The file has been replaced by the traditionalwtmpandutmpfiles which now keep track of all logins and logouts on the system./var/log/ConsoleKit/historyprovided similar information as thewtmpfile, though in a different format. Given the overlap in functionality,logindonly adopted thewtmpfile's role. - seat.d scripts
- Since
ConsoleKitis no longer in use,seat.dscripts no longer complement theConsoleKitframework, and have been replaced bysystemd-logind. - the ck-list-sessions command
ConsoleKitprovided theck-list-sessionscommand, 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 theloginctlcommand:loginctl list-sessions
$ loginctl list-sessionsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - multi-seat support
logindalong withGDMprovide 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
$ loginctl list-seatsCopy to Clipboard Copied! Toggle word wrap Toggle overflow To show the status of a specific seat on the system, run the following command:loginctl seat-status seat
$ loginctl seat-status seatCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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
# loginctl attach seat deviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow where seat is the name of the seat, for exampleseat1, and device is the device name specified with the/sysdevice 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-devicescommand.
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.