[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Login Shell/Profile: Stop the Madness



Matthias Czapla wrote:

On Sat, Jul 17, 2004 at 01:20:13PM -0400, Daniel B. wrote:

It would be sensible if logging in via a display manager included
the same shell login initialization that logging in on a virtual
console performed.  (Or via telnet, rlogin, ssh, etc.)


I agree, that would be most sensible.


Now do you have the display manager source every possible file that
should be sourced for each possible shell?

No. But what the display manager should do at some point is start a login shell (that is, start the user's selected shell, with the standard login flag for shell programs so that shell reads the
user's login-time files).

That's what logging in to a virtual console does.


Yes, and then this login shell keeps running and is the parent of
any subsequently started processes. If the display manager just
starts a login shell then this shell is unable to change the
environment of it's parent (the dm)

Why would it need to?   (Also, see below about running part of the
DM under a shell process.)

> and if this shell exits
everything will be exactly as it was before it has been run.

Right, but it wouldn't be used in a way that it exits.

So we would need to start a login shell that will become the parent
process of everything else that you would like to have an
initialized environment.

Exactly, except that the login shell doesn't have to the direct
parent of every other process; it just has to be an ancestor.

>  I don't know how a dm works internally to
say if this is possible though :|

Part of the display manager (or window manager or whichever part
exactly) should invoke the user's chosen shell as a login shell
with a command telling it to run a command that invokes the rest
of the display manager (or ...).

The results are that:
- a login instance of the user's chosen interactive shell gets a
  chance to run and do its login-time initialization, the user's
  usual shell environment settings are used
- the display manager (or ...) gets control back to do everything it
  needs to do
- the environment of the second display manager process reflects
  the user's login shell environment settings
- processes spawned by that window manager process also relect the
  user's login shell environment settings


Daniel



Reply to: