mate-desktop / mate-session-manager

MATE session manager
https://mate-desktop.org
GNU General Public License v2.0
28 stars 35 forks source link

Shouldn't add XDG_SESSION_ID to dbus and systemd activation environment #271

Open smcv opened 3 years ago

smcv commented 3 years ago

Steps to reproduce the behaviour

Expected behaviour

Actual behaviour

MATE 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:

smcv commented 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.

L-U-T-i commented 3 years ago

@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...

smcv commented 3 years ago

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.

raveit65 commented 3 years ago

Pull request please.

sunweaver commented 3 years ago

@smcv @raveit65 @L-U-T-i I have already filed a PR for the minimal required changes here: #282