GNOME adapted for systemd management

Benjamin Berg (benjamin berg), one of the Red Hat engineers involved in the development of GNOME, summarized the results of the work on moving GNOME to session management exclusively through systemd, without using the gnome-session process.

GNOME login management has been used for quite some time now. systemd-logind, which monitors session states in relation to the user, manages session IDs, is responsible for switching between active sessions, coordinates multi-user environments (Multi-seat), configures device access policies, provides means to shut down and go to sleep, etc. .

At the same time, part of the session-related functionality remained on the shoulders of the gnome-session process, which was responsible for managing via D-Bus, launching the display manager and GNOME components, organizing autorun of user-specified applications. During the development of GNOME 3.34, gnome-session-specific features were packaged as unit files for systemd to run in "systemd --user" mode, i.e. in relation to the environment of a particular user, and not the entire system. The changes have already been applied in the Fedora 31 distribution, which is expected to be released at the end of October.

The use of systemd made it possible to organize the launch of handlers on demand or on the occurrence of certain events, as well as more sophisticated response to premature termination of processes due to failures, and extensive dependency handling when starting GNOME components. As a result, you can reduce the number of constantly running processes and reduce memory consumption. For example, XWayland can now only be launched when trying to run an application based on the X11 protocol, and hardware-specific components, only with such hardware (for example, handlers for smart cards will be launched when a card is inserted and terminated when it is removed).

More flexible tools for managing the launch of services have appeared for the user, for example, to disable the media key handler, it will be enough to execute β€œsystemctl –user stop gsd-media-keys.target”. In case of problems, the logs associated with each handler can be viewed with the journalctl command (for example, "journalctl -user -u gsd-media-keys.service"), after enabling debug logging in the service ("Environment=G_MESSAGES_DEBUG=all"). It also became possible to run all GNOME components in isolated sandbox environments, which are subject to increased security requirements.

To smooth the transition, support for the old way of running processes is planned save over multiple GNOME development cycles. Next, the developers will review the state of gnome-session and most likely (marked as "likely") remove the process launchers and maintainers of the D-Bus API from it. Then the use of "systemd --user" will be moved to the category of mandatory functions, which can create difficulties for systems without systemd and require the preparation of an alternative solution, as was once done with systemd-logind. However, in his GUADEC 2019 keynote, Benjamin Berg mentioned his intention to keep support for the old startup method for systems without systemd, but this information is at odds with plans for project page.

Source: opennet.ru

Add a comment