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

Re: /etc/environment

Mark Baker writes:
 > Yes, it is that simple. It isn't read by the user's shell. It's
 > read by login or ssh, and is inherited by the user's shell and
 > therefore all their other programs.
 > In the case of xdm logins, it can be read in the Xsession[1]
 > which is always a sh script, and will then be inherited by
 > their window manager, and so by any shells etc that are in
 > xterms they open.

    I think it's a great idea to be able to specify an environment
from /etc/environment that is setup before any shell does its
.profile thing.  But, I would wager a guess that the problem that
is being attemped to be solved is this one:

    With a console login, your shell sets up your .profile, with
    an xdm login, your .profile is not set up.

    Many people try to solve this problem by having their xterms
tell the shell that it is a login shell.  But this doesn't help
programs launched from x window menus at all.

    IMNSHO, the easiest solution is to have the user's .xsession
just do the login type .profile thing itself.  My .xsession follows.


Jeff Sheinberg  <jeffsh@erols.com>

    # .xsession - Startup file exec-ed from /etc/X11/Xsession.

    # Timestamp session error file.
    echo "$0: on $(date)"

    # I tried `#!/bin/bash -login' here, but it complained that "stdin:
    # is not a tty", so we have to emulate a bash login.

    if [ -f /etc/profile ]; then
      .  /etc/profile

    if [ -f ~/.bash_profile ]; then
      .  ~/.bash_profile
    elif [ -f ~/.bash_login ]; then
      .  ~/.bash_login
    elif [ -f ~/.profile ]; then
      .  ~/.profile

    # Let members of the xlocal group read the xauth file.
    chown -v .xlocal ~/.Xauthority
    chmod -v g+r ~/.Xauthority

    # Load the resources into the root window.
    xrdb -load ~/.Xresources

    # Run the clients which includes exec-ing the controlling process.
    .  ~/.xclients

    # Now simulate bash logout.
    if [ -f ~/.bash_logout ]; then
      .  ~/.bash_logout

    exit 0

# .xsession - end of file.

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: