Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've found that when logging in graphically the shell loading process works differently than logging in through the console. Environment variables such as $BASH_VERSION and $ZSH_VERSION are not set when logging in graphically, and a script specifically written for bash and zsh that I tried to use while logging in causes the login process to restart and returns me to the login prompt (which stops me from logging in while this script is in place), when logging in through the console the same setup works fine though.

In this chruby-thread on github I talk about the case where I am experiencing the issue. Is the shell loading process working as it should when logging in graphically, and if so is there any documentation on how it works (and if so, where can I find it)? How should I make this work?

share|improve this question
    
Robert Ancell re-opened my question on Launchpad and posted an answer on answers.launchpad.net/lightdm/+question/219654 that clarifies some of this, I have asked him for more information. –  mkrmr Feb 7 '13 at 9:00
add comment

1 Answer

If you start a X11 session, the ~/.profile and similar files are not sourced.

If you want to enforce this, create a file /etc/X11/Xsession.d/95-enforce-profile with the following content:

    # This file is sourced by Xsession(5), not executed.
    # source user profile
    if test -e ~/.bash_profile
    then
        . ~/.bash_profile
    else
        [ -e ~/.profile ] && . ~/.profile
    fi
share|improve this answer
    
Sorry for not responding sooner, I didn't see your notification earlier. I don't think this would work, because the script that I have is not compatible with dash (which is the shell that seems to be executing these scripts) –  mkrmr Mar 7 '13 at 8:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.