FS#52810 - [gnome-session] Profile not loaded by gnome-session when using Wayland

Attached to Project: Arch Linux
Opened by Alexander Pavel (SuperIce97) - Wednesday, 01 February 2017, 17:52 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 03 February 2017, 17:18 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: Gnome-session/GDM does not load /etc/profile and the scripts in /etc/profile.d when using Wayland for GDM and/or gnome-session. This means that certain programs that need something from a profile script may not work as expected.


Additional info:
* gnome-session 3.22.2-2

Steps to reproduce:
1. Install a program that uses a profile script (like libreoffice-fresh)
2. Change the default value in the profile script (/etc/profile.d/libreoffice.sh if using previous example)
3. Program does not use values in profile script after reloading gnome-session/gdm (for example, if you change the VCL for libreoffice-fresh, it won't be used and libreoffice will continue using the default of gtk3)

This bug has existed for nearly 2.5 years and has not yet been fixed in mainline: https://bugzilla.gnome.org/show_bug.cgi?id=736660

This was noticed a couple months ago by Arch users here: https://bbs.archlinux.org/viewtopic.php?id=218197. There is currently one fix in the post from 2016-12-22. Here is the patch that was posted:
<code>
--- /usr/bin/gnome-session.old 2016-12-22 14:30:16.118497829 +0000
+++ /usr/bin/gnome-session 2016-12-22 14:35:16.069513827 +0000
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/zsh -l

SETTING=$(gsettings get org.gnome.system.locale region)
REGION=${SETTING#\'}
</code>

I can confirm that it works, but this obviously would need zsh as a dependency so I'm not sure this is the best course of action due to that dependency.
This task depends upon

Closed by  Doug Newgard (Scimmia)
Friday, 03 February 2017, 17:18 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#51341 
Comment by Jan de Groot (JGC) - Friday, 03 February 2017, 09:14 GMT
Fixed for this were backported to 3.22.2-2.
Comment by Alexander Pavel (SuperIce97) - Friday, 03 February 2017, 14:41 GMT
Gnome-session will load variables set in "/etc/environment" correctly, but not from "/etc/profile" and thus "/etc/profile.d/*".
According to the wiki, Arch only initializes variables in /etc/profile for login shells. Could that be the reason "/etc/environment" loads correctly but not "/etc/profile"?
Comment by Jan de Groot (JGC) - Friday, 03 February 2017, 15:07 GMT Comment by Alexander Pavel (SuperIce97) - Friday, 03 February 2017, 15:22 GMT
Yeah, my /usr/bin/gnome-session script is correct and has that, but it does not load the variables from /etc/profile. If I change the top line from "#!/bin/sh" to "#!/bin/zsh -l" it works fine, so something is probably wrong with how the script is implemented or with how Arch handles starting gnome-session that causes the script to not detect that it's using Wayland correctly. I'm just not sure what exactly is wrong.
Comment by Jan de Groot (JGC) - Friday, 03 February 2017, 15:25 GMT
The script re-executes itself using a login shell if certain conditions are met. What's $SHELL and $XDG_SESSION_TYPE in your situation?
Comment by Alexander Pavel (SuperIce97) - Friday, 03 February 2017, 15:29 GMT
I'm not sure how to check the shell that executes gnome-session (I use zsh as my main shell) and running "echo $XDG_SESSION_TYPE" returns wayland

Loading...