Skip to content

Add graphical session support#204

Open
leigh123linux wants to merge 1 commit into
linuxmint:masterfrom
leigh123linux:graphical-session
Open

Add graphical session support#204
leigh123linux wants to merge 1 commit into
linuxmint:masterfrom
leigh123linux:graphical-session

Conversation

@leigh123linux
Copy link
Copy Markdown
Member

@leigh123linux leigh123linux commented May 27, 2026

This pull request adds integration with systemd user units to improve session management in Cinnamon. The main changes introduce new helper functions for starting and stopping systemd units, export the user environment to systemd, and ensure that systemd user targets are started and stopped appropriately during session lifecycle. Additionally, systemd unit files for Cinnamon session are now installed as part of the build.

Systemd integration and environment export:

  • Added new helper functions in csm-util.c and declarations in csm-util.h for starting (csm_util_start_systemd_unit), stopping (csm_util_stop_systemd_unit), and exporting the session environment (csm_util_export_systemd_activation_environment) to systemd via D-Bus. These functions ensure that the Cinnamon session can signal systemd to manage its lifecycle and environment correctly. [1] [2]
  • Updated main.c to export the environment to systemd and start the cinnamon-session.target unit at session startup, with error handling if the export fails.
  • Modified csm-manager.c to start the cinnamon-session.target unit when entering the running phase and stop it during session exit, ensuring systemd is kept in sync with the session state. [1] [2]

Build system and unit files:

  • Added installation of new systemd user unit file cinnamon-session.target and updated Meson build scripts to install it to the correct directory, handling systemd's install path via pkg-config if available. [1] [2] [3] [4] [5]

These changes ensure that Cinnamon session integrates smoothly with systemd for user session management, allowing better coordination of session services and environment propagation.

@Fantu
Copy link
Copy Markdown
Contributor

Fantu commented May 27, 2026

Thanks, integrating and manage the cinnamon session from systemd I think will be a good improvement, like other DEs already done.
From a quick look, however, I don't quite understand how it handles any failures, and regarding systemd-oomd (which is the default in Fedora) but I haven't retested yet to see if the problems I saw on Debian at the beginning are still there, is it already set up to have a lower probability of being killed without specific parameters?
And regarding the reboot that was added in Cinnamon in case of excessive RAM consumption, doesn't require modifications for this?

@leigh123linux
Copy link
Copy Markdown
Member Author

I don't quite understand how it handles any failures, and regarding systemd-oomd (which is the default in Fedora) but I haven't retested yet to see if the problems I saw on Debian at the beginning are still there, is it already set up to have a lower probability of being killed without specific parameters?

I haven't tested if it handles failures gracefully , there isn't much to fail.

And regarding the reboot that was added in Cinnamon in case of excessive RAM consumption, doesn't require modifications for this?

Does that restart cinnamon-session-binary?

@Fantu
Copy link
Copy Markdown
Contributor

Fantu commented May 27, 2026

Cinnamon have internal launcher, cinnamon-killer-daemon and probably also other part without a systemd service, these not affect the session part as "another level"?
anyway I suppose that moving also these to systemd service can be better? or I'm wrong?

looking for example gnome-shell have systemd services, for example this: https://salsa.debian.org/gnome-team/gnome-shell/-/blob/debian/latest/data/org.gnome.Shell@.service.in?ref_type=heads
and probably will be an improvement do also in cinnamon, about oom killer there is OOMScoreAdjust=-1000 in gnome shell service, so will be better also for that case
I'm not sure how to reboot in case of excessive memory leaks, memorymax if I'm not wrong kill and wayland session seems can't be restarted, I don't know how is managed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants