After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 656094 - gdm should not hardcode the path to the gnome-session executable
gdm should not hardcode the path to the gnome-session executable
Status: RESOLVED NOTABUG
Product: gdm
Classification: Core
Component: general
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-07 04:56 UTC by Alexandre Rostovtsev
Modified: 2011-10-27 14:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for current gdm master branch HEAD (5.82 KB, patch)
2011-08-07 07:12 UTC, Alexandre Rostovtsev
none Details | Review
patch for gdm gnome-3-0 branch (6.03 KB, patch)
2011-08-07 07:13 UTC, Alexandre Rostovtsev
none Details | Review

Description Alexandre Rostovtsev 2011-08-07 04:56:56 UTC
This issue affects gdm-3.0.x and 3.1.x.

Due to an annoying bug in my video driver, I must run the gnome-session executable with a particular environment variable set[1] - or the gnome-session process will hang on exit. And since gdm starts a gnome-session process, when that gnome-session hangs, the gdm greeter will hang, thus making it impossible to log in.

However, gdm_greeter_session_new() in gdm-greeter-session.c hardcodes the path to gnome-session, while get_welcome_environment() and gdm_welcome_session_spawn() in gdm-welcome-session.c drop all non-i18n-related custom environment variables in spawned processes. As a result, short of recompiling gdm, there is no way for me to work around the video driver bug; gdm will ignore the environment in which it is launched, and will not load a custom /usr/local/bin/gnome-session wrapper script.

The most direct and easiest way of fixing this situation is to not hardcode the path to the gnome-session executable.

It would also be nice (although not strictly necessary, as long as the gnome-session path is not hardcoded) if there was a way to customize the list of environment variables that are passed to spawned session processes.

[1] If you really wish to know, the variable is __GL_NO_DSO_FINALIZER=1, and the driver is nvidia proprietary.
Comment 1 Alexandre Rostovtsev 2011-08-07 07:12:49 UTC
Created attachment 193369 [details] [review]
patch for current gdm master branch HEAD

This patch removes the hardcoded location for gnome-session, and allows gnome-session to be loaded using normal PATH rules, making it possible to use custom wrappers for the gnome-session executable.

In addition, it overhauls the logic for how environment variables in spawned session processes are set. Instead of inheriting i18n variables from the current process and then setting the needed ones, it:
1. sets needed environment variables;
2. inherits environment variables that had not been set in step 1 from the current process;
3. drops specific variables that may cause problems.

This allows a system administrator to force gdm to spawn sessions with a particular custom environment variable set to e.g. work around hardware driver bugs.
Comment 2 Alexandre Rostovtsev 2011-08-07 07:13:47 UTC
Created attachment 193370 [details] [review]
patch for gdm gnome-3-0 branch

Same as above, but backported to the gnome-3-0 branch.
Comment 3 Alexandre Rostovtsev 2011-10-26 21:01:54 UTC
On second thought, pam_env can already be easily used to set particular environment variables for sessions launched by gdm. In fact, a pam_env solution is much better than my patch because unlike the patch, using pam_env would not break pam_mktemp etc.

So marking this as not a bug.
Comment 4 Ray Strode [halfline] 2011-10-27 14:20:18 UTC
Alright, thanks for the patch and effort, though.