Bug 173438

Summary: GDM Xsession does not start a login shell; .bash_profile doesn't run
Product: [Fedora] Fedora Reporter: Anders Kaseorg <andersk>
Component: gdmAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED DUPLICATE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: hp, jeroen, scop, xgl-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-10 02:56:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 150222    

Description Anders Kaseorg 2005-11-17 02:50:02 UTC
Description of problem:
In FC4, the /etc/X11/xdm/Xsession script ran the desktop inside a login shell:
  exec -l $SHELL -c "$SSH_AGENT $DBUS_LAUNCH gnome-session"
But in FC5, /etc/X11/gdm/Xsession only makes a half-hearted attempt at sourcing
~/.profile (regardless of what the user's shell actually is), and does not run a
login shell:
  eval exec $sshagent $dbuslaunch $command
Thus, the user's ~/.bash_profile (or equivalent configuration for whatever shell
they use) never gets run.

Version-Release number of selected component (if applicable):
gdm-2.8.0.4-12

How reproducible:
Always

Steps to Reproduce:
1. Put something useful in ~/.bash_profile
2. Log in with GDM

Comment 1 Lars G 2005-11-17 11:41:00 UTC
same behavior here

Comment 2 Kenneth Topp 2005-11-23 19:29:13 UTC
see bug  173463 

Comment 3 Michal Jaegermann 2005-11-23 22:42:14 UTC
At least for now the following patch:

--- /etc/X11/gdm/Xsession~	2005-11-16 11:12:59.000000000 -0700
+++ /etc/X11/gdm/Xsession	2005-11-23 15:19:56.000000000 -0700
@@ -36,7 +36,8 @@ echo "$0: Beginning session setup..."
 
 # First read /etc/profile and .profile
 test -f /etc/profile && . /etc/profile
-test -f "$HOME/.profile" && . "$HOME/.profile"
+test -f "$HOME/.bash_profile" && . "$HOME/.bash_profile" || \
+{ test -f "$HOME/.profile" && . "$HOME/.profile"; }
 # Second read /etc/xprofile and .xprofile for X specific setup
 test -f /etc/xprofile && . /etc/xprofile
 test -f "$HOME/.xprofile" && . "$HOME/.xprofile"

allows to run ~/.bash_profile or ~/.profile.  This clearly is not doing
anything useful with ssh_agent.

Comment 4 Mike A. Harris 2005-11-24 16:51:15 UTC
Why isn't gdm using the system Xsession?  Please change it to do that
instead.  Let me know if there is a problem with the system one so it
can be fixed, rather than shipping multiple inconsistent versions.

TIA


Comment 5 Mike A. Harris 2005-11-24 16:51:48 UTC
*** Bug 173463 has been marked as a duplicate of this bug. ***

Comment 6 Havoc Pennington 2005-11-25 10:41:36 UTC
*** Bug 174157 has been marked as a duplicate of this bug. ***

Comment 7 Havoc Pennington 2005-11-25 10:42:53 UTC
Changing to:
   exec -l $SHELL -c "otherstuff"
in the gdm Xsession fixes it for me.


Comment 8 Anthony Thyssen 2005-11-30 06:11:06 UTC
The gdm/Xsession script also will not look for .xinitrc at all, and will only
execute a .xsession if it is found and executable, AND "custom" (rather than
"default") is given from the GDM login.  However "custom" is not provided and
should not be needed to handle a users ".xsession" script.

The old xdm/Xsession  will execute it, or even exec a bash on it!

This is not good!

Comment 9 Anthony Thyssen 2005-11-30 06:11:41 UTC
The gdm/Xsession script also will not look for .xinitrc at all, and will only
execute a .xsession if it is found and executable, AND "custom" (rather than
"default") is given from the GDM login.  However "custom" is not provided and
should not be needed to handle a users ".xsession" script.

The old xdm/Xsession  will execute it, or even exec a bash on it!

This is not good!

Comment 10 Ray Strode [halfline] 2005-11-30 16:12:08 UTC
Hi,

Yea we should probably just go back to the old one.  I'll have a look sometime
this week.

Comment 11 Ville Skyttä 2005-11-30 16:32:23 UTC
Setting BaseXsession=/etc/X11/xinit/Xsession in gdm.conf seems to be working
well here.

Comment 12 Ray Strode [halfline] 2006-01-10 02:56:47 UTC
Hey guys, should be fixed in tomorrow's rawhide (and test2)

*** This bug has been marked as a duplicate of 177258 ***