Bug 174355 - bash-completion cause GDM to not start session in Modular X
bash-completion cause GDM to not start session in Modular X
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: bash-completion (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-28 07:32 EST by Paul Dickson
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 20050721-2.fc5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-28 15:46:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
My $HOME/.profile (128 bytes, text/plain)
2005-11-28 07:32 EST, Paul Dickson
no flags Details

  None (edit)
Description Paul Dickson 2005-11-28 07:32:11 EST
Description of problem:
If bash_completion.sh exists in /etc/profile.d, /etc/X11/gdm/Xsession ultimately
runs that script twice.  The second time it seems to perform an "exit", which
terminates Xsession (which invokes /etc/profile and ~/.profile with a ".".

Version-Release number of selected component (if applicable):
bash-completion-20050721-1.fc5
bash-3.0-37
gdm-2.8.0.4-13

How reproducible:
Always

Steps to Reproduce:
1. My ~/.profile does ". /etc/profile" then adds additional paths to PATH
2. Logout, login via gdm.
3.
  
Actual results:
GDM complains that the session last less than 10 seconds.  There is no error
messages.

Expected results:
Gnome's (or KDE's) session should start.

Additional info:
Debugging echo's trace the run through /etc/X11/gdm/Xsession through a
successful run of ". /etc/profile", but the echo after ". $HOME/.profile" never
happens.

If I rename the bash_completion.sh script (bash_completion.sh.tmp), I can log in.

I can't seem to find an exit in bash_completion.sh.
Comment 1 Paul Dickson 2005-11-28 07:32:11 EST
Created attachment 121541 [details]
My $HOME/.profile
Comment 2 Ville Skyttä 2005-11-28 08:29:12 EST
Reproduced.

One way to debug stuff like this is to add eg. a "set -x" somewhere near the top
of /etc/X11/gdm/Xsession, then try logging in, and while the gdm dialog about
things going south is still visible, peek into /tmp/xses-$USERNAME.XXXXXX from a
virtual terminal.

Anyway, from debugging like in above, it seems it has something to do with the
"readonly" stuff at top of /etc/bash_completion.  When the session prematurely
aborts (when sourcing it for the second time), the "set +v" at the top is the
last thing run.

I don't see anything wrong offhand with the code, but one potential workaround
is to change this at the top of /etc/profile.d/bash_completion.sh:

    [ -z "$BASH_VERSION" ] && return

...to:

    [ -z "$BASH_VERSION" -o -n "$BASH_COMPLETION" ] && return

I'm not sure if this is the best possible way around it but it seems to work for
me.  Could you try it out?
Comment 3 Paul Dickson 2005-11-28 10:26:24 EST
Yes adding the ' -o -n "$BASH_COMPLETION"' works around the problem for me.
Comment 4 Ville Skyttä 2005-11-28 15:46:36 EST
Thanks, this workaround will be in 20050721-2.fc5.

Note You need to log in before you can comment on or make changes to this bug.