Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jun 2005 15:09:27 +0100
From:      RW <list-freebsd-2004@morbius.sent.com>
To:        freebsd-questions@freebsd.org
Subject:   KDM and .bash_profile problem
Message-ID:  <200506141509.27301.list-freebsd-2004@morbius.sent.com>

next in thread | raw e-mail | index | archive | help
I think it used to be the case that if you used kdm to login, 
then .bash_profile would not get sourced by bash (because it's not a login 
shell). However it appears that  the Xsession script 
in  /usr/local/share/config/kdm now sources .bash_profile explicitly if bash 
is your shell.

My problem is that when .bash_profile is sourced this way, I only pick-up 
environmental variables, and any aliases or bash functions don't work. They 
work as expected when I login via a virtual-terminal, so I don't think it is 
my script. 

For those who don't have kdm, this is the Xsession file:
--------------------------------------------------------------------------
#! /bin/sh
# Xsession - run as user

session=$1

# Note that the respective logout scripts are not sourced.
case $SHELL in
  */bash)
    [ -z "$BASH" ] && exec $SHELL $0 "$@"
    set +o posix
    [ -f /etc/profile ] && . /etc/profile
    if [ -f $HOME/.bash_profile ]; then
      . $HOME/.bash_profile
    elif [ -f $HOME/.bash_login ]; then
      . $HOME/.bash_login
    elif [ -f $HOME/.profile ]; then
      . $HOME/.profile
    fi
    ;;

# ...OTHER SHELL CASE ENTRIES SNIPPED  #

esac

[ -f /etc/xprofile ] && . /etc/xprofile
[ -f $HOME/.xprofile ] && . $HOME/.xprofile

case $session in
  "")
    exec xmessage -center -buttons OK:0 -default OK "Sorry, $DESKTOP_SESSION 
is no valid session."
    ;;
  failsafe)
    exec xterm -geometry 80x24-0-0
    ;;
  custom)
    exec $HOME/.xsession
    ;;
  default)
    exec /usr/local/bin/startkde
    ;;
  *)
    eval exec "$session"
    ;;
esac
exec xmessage -center -buttons OK:0 -default OK "Sorry, cannot execute 
$session. Check $DESKTOP_SESSION.desktop."
--------------------------------------------------------------------------





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506141509.27301.list-freebsd-2004>