gdm conflicts with bash_completion.d

Marius Gedminas marius at
Tue Sep 19 10:12:28 UTC 2006

On Mon, Sep 18, 2006 at 10:35:29PM +0200, Marco wrote:
> I just switched back to gnome. But gdm can start any session, neither gnome
> nor kde, unless I remove the file from /etc/bash_completion. Why?

You haven't given us enough information about your setup, so I'll have
to do some guessing.

You're probably sourcing your ~/.bashrc from ~/.xsession or from
~/.gnomerc, and you're probably sourcing /etc/bash_completion from

GDM executes the session script under /bin/sh, which is not necessarily
bash.  /bin/sh may barf on bash-specific commands such as those found in
/etc/bash_completion.  If it barfs, your xsession script gets terminated
and you cannot log in.

> Do I have to cut down bash_completion?

No, just make sure you don't run it from your session script.

I've taken two precautionary measures: in my ~/.gnomerc I have

  # do not abort the script on first error, that makes login impossible
  set +e
  source ~/.bash_profile
  set -e

and in my ~/.bashrc (which is sourced from ~/.bash_profile) I have

  # If not running interactively, don't do anything
  [ -z "$PS1" ] && return

before I source /etc/bash_completion.

I hope this helps,
Marius Gedminas
BYTE editors are people who separate the wheat from the chaff, and then
carefully print the chaff.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <>

More information about the ubuntu-users mailing list