Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 86361 - xdm does not start proper login shell
xdm does not start proper login shell
Product: Red Hat Linux
Classification: Retired
Component: XFree86 (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: X/OpenGL Maintenance List
David Lawrence
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2003-03-20 12:03 EST by David Sachs
Modified: 2007-04-18 12:52 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-09-29 15:08:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Sachs 2003-03-20 12:03:53 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)

Description of problem:
login via xdm apparently does not create a proper login shell process. 

In particular, if the user's default shell is bash, the .bash_profile 
and .bash_logout scripts are not run at the proper times.

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

How reproducible:

Steps to Reproduce:
1.Set up Linux machine with xdm (x windows)
2.Create user with bash as login shell
3.Create .bash_profile and .bash_logout scripts for this user whose execution 
can be verified.
4.Log in and check if .bash_profile has been run
5.Log out from xdm session and check for .bash_logout having been run

Actual Results:  Commands in the .bash_profile, and .bash_logout were never run.

Expected Results:  Commands in .bash_profile should be run as soon as user logs 
in BEFORE his xdm session is visible.

Commands in .bash_logout should be run when xdm seesion is terminated.

Additional info:

The first process run with the logged in user's id appears to be /bin/sh which 
runs the script to run KDE (or GNOME ...). This process needs to be changed to 
be a LOGIN shell for the user.
Comment 1 Mike A. Harris 2004-09-29 15:08:17 EDT
When logged into xdm/gdm/kdm or while in an X session started from
the commandline via "startx", by default most (possibly all) X
terminal emulators start up using non-login subshells.

The "bash" shell only processes the .bash_profile file on interactive
login shells, so by default, starting any terminal emulator without
specifying a login shell will give a non-login subshell.  This is
expected behaviour.

If you have any commands present in .bash_profile which you would
like to have invoked automatically by all shells, it is best to
place this code in the .bashrc file instead, as that is sourced
by all shells.

The full rules for which startup files are sourced by bash under
various conditions are documented in detail on the bash manpage
under the "INVOCATION" section.

If you prefer nonetheless to have your terminals invoke login
shells always, refer to the terminal emulator's commandline
usage screen, manpages or other documentation for how to invoke
the shell as a login shell.  For xterm, this can be done by
invoking it as "xterm -ls".  Other terminals have similar
commandline switches that may work the same.

Setting status to "NOTABUG".

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