Open smcv opened 3 years ago
A minimal solution is to apply the equivalent of GNOME/gnome-session@646b9bc to mate-session-manager, but all the commits mentioned in https://github.com/linuxmint/cinnamon-session/pull/141#issuecomment-809590165 touch the same file and would be good fixes to have.
@smcv based on your posts, I've made a test build of the latest git commit of mate-session-manager 1.25 with the following patches applied (in an order as listed here):
1 - Remove some session-specific environment variables from activation environment: mate-session-manager-1.25-271-fix-1.patch.txt
2 - Fix environment variables patterns that are accepted: mate-session-manager-1.25-271-fix-2.patch.txt
3 - Never try to autostart systemd: mate-session-manager-1.25-271-fix-3.patch.txt
4 - Continue if a client exits during EndSession signal: mate-session-manager-1.25-continue-if-a-client-exits-during-EndSession-signal.patch.txt
5 - Log a critical when our SIGTERM/SIGINT handler fails to log out: mate-session-manager-1.25-log-a-critical-when-our-SIGTERM-SIGINT-handler-fails-to-log-out.patch.txt
6 - Stop dbus-daemon instead of restarting it: mate-session-manager-1.25-stop-dbus-daemon-instead-of-restarting-it.patch.txt
7 - Warn about failures to update the environment: mate-session-manager-1.25-warn-about-failures-to-update-the-environment.patch.txt
8 - Log variables excluded from environment upload: mate-session-manager-1.25-log-variables-excluded-from-environment-upload.patch.txt
9 - Create the config directory with 0700: mate-session-manager-1.25-create-the-config-directory-with-0700.patch.txt
10 - Fix typos in DBus documentation: mate-session-manager-1.25-fix-typos-in-DBus-documentation.patch.txt
11 - Mention that session saving does not work on systemd: mate-session-manager-1.25-mention-that-session-saving-does-not-work-on-systemd.patch.txt
12 - Find user's graphical session, not the current pid's session: mate-session-manager-1.25-gsm-systemd-1.patch.txt
All those patches are ported from gnome-session git commits (and, modified as needed, in some rare cases).
There are more details about each patch within the patch file itself (copied from gnome-session commit descriptions).
I haven't noticed any issues by now (built, installed and launched without any issues...). As I've noticed sessions were not always properly saved / restored in my Mate Desktop (some rare cases, but still...), I've decided to give all this a try. I know some of those patches (a majority of them, in fact ;-)) are not related to this issue at all, but considering I went through all recent git commits of gnome-session, I've decided to simply pull anything that seemd to me appropriate for mate. I am publishing all that here, in case anyone is interested for any part of that...
I'm not a MATE developer or user, so someone from MATE should review those changes, but I think the general principle of sharing non-GNOME-specific fixes between GNOME and MATE is a good one.
Pull request please.
@smcv @raveit65 @L-U-T-i I have already filed a PR for the minimal required changes here: #282
Steps to reproduce the behaviour
Expected behaviour
mate-session-manager
uploads some environment variables todbus-daemon --session
viaUpdateActivationEnvironment
, and eithermate-session-manager
itself ordbus-daemon
passes on those environment variables tosystemd --user
viaSetEnvironment
systemd --user
anddbus-daemon --session
processes are shared between multiple login sessions, these environment variables should not include things that are highly specific to one login session, and in particularXDG_SEAT
,XDG_SESSION_ID
andXDG_VTNR
systemd --user
, including most of GNOME, do not inheritXDG_SESSION_ID
XDG_SESSION_ID
, correctly determines its own systemd-logind session ID (in my example, session ID 6) by querying systemd-logind, and can lock and unlock correctlyActual behaviour
mate-session-manager
sends all environment variables tosystemd --user
, includingXDG_SESSION_ID=4
in my examplesystemd --user
alive,XDG_SESSION_ID=4
stays in the activation environment and is "leaked" into the subsequent GNOME sessionXDG_SESSION_ID=4
fromsystemd --user
, even though that login session has already endedgnome-session
to work around this, but I don't think it's really a GNOME bugMATE general version
1.24.1 (not tested with 1.24.2, but none of the changes since 1.24.1 seem like they would affect this)
Package version
1.24.1-1
Linux Distribution
Debian 11
Link to bugreport of your Distribution (requirement)
https://github.com/linuxmint/cinnamon-session/pull/141#issuecomment-809590165 lists some other related fixes in the ancestor project gnome-session. It would be a good idea to incorporate those into mate-session-manager at the same time.
Related bug reports: