Bug 7860 - gdm session startup scripts don't honour user shell
Summary: gdm session startup scripts don't honour user shell
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gnome-core
Version: 6.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact:
: 46475 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 1999-12-17 02:27 UTC by Paul Gear
Modified: 2007-03-27 03:29 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-04-14 17:55:13 UTC

Attachments (Terms of Use)

Description Paul Gear 1999-12-17 02:27:37 UTC
Most of the session startup scripts in /etc/X11/gdm/Sessions/ have a
hard-coded "#!/bin/bash -login" as their first line.

This means that if the user uses /bin/ksh and hasn't cleaned up the .bash*
files that are supplied in /etc/skel, these files will get executed instead
of their .profile.  (I don't know what happens if tcsh or similar is used,
but i expect it would be even worse.)

I recommend that these scripts be modified to remove the '-login' option to
bash, and have gdm exec the user's login shell manually the way /bin/login
does (by prefixing a '-' to $0), and specify the script to execute on the
command line.  A similar change will likely be required in

Comment 1 Havoc Pennington 2000-02-04 22:24:59 UTC
Release 23 of gdm2.0-beta2 has an attempted fix for this, if it doesn't work
for you then please let us know.

Comment 2 Paul Gear 2000-02-25 01:36:59 UTC
No luck.  Here's what i did:
- Use useradd to create a dummy test user (including the default .bash*) files
- Use vipw to change their shell to /bin/ksh
- Add a line to each of the startup files (.bash_profile, .bashrc, .bash_logout,
.kshrc, .profile) which echos the date and the filename to a file, e.g.:
        echo `date`:  .profile >> $HOME/output
- Login as the test user and start a terminal window
- cat output.  The output given is:
Fri Feb 25 11:16:14 EST 2000: .bashrc
Fri Feb 25 11:16:14 EST 2000: .bash_profile
Fri Feb 25 11:16:14 EST 2000: .bashrc

So, even though the user's shell is ksh, their bash startup files get executed
instead of their ksh files, and they get confused!  :-)

Comment 3 Havoc Pennington 2001-07-18 18:34:28 UTC
It turns out that this needs fixing in the Xsession script, rather than in gdm.

Comment 4 Mike A. Harris 2001-07-30 07:28:00 UTC
*** Bug 46475 has been marked as a duplicate of this bug. ***

Comment 5 Mike A. Harris 2001-07-31 07:39:24 UTC
The needed changes were made to Xsession by removing its own -login 
invocation and replacing "exec foo" calls with:

exec -l $SHELL -c foo

Handing this back to Havoc to close if he believes gdm is ready to roll
with this change.

Havoc, also note, any scripts in gnome/kde that rely on this new xinitrc
package should have their dependancies updated to reflect that also.  Good idea
to also comment why the dep is there too as I've learned.  ;o)

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