I've been searching the forum for about 30 minutes but can't find this issue discussed anywhere. Apologies if there's a thread I missed - just point me thattaway if that's the case.

Briefly, I have added a bin directory to my home directory (the pi account) and added the path to the c++ include libraries to my .profile but neither the path to the bin directory (which should be added to the PATH env variable by legacy code in the .profile) nor the library path (which I added myself to the PATH setting in that .profile) are being appended/prepended to the PATH variable until I manually source the .profile, at which point everything works as expected.

I have none of the conditions laid out in the comments in the .profile that would preclude its not being run at login.

This problem manifests on boot and upon logging out and logging back in. It is as though the .profile in my home directory just doesn't exist.

The Pi is an early run model B with 256 MB memory (all but 16 meg given to the CPU), a wheezy distro running on a good quality (they claim 30MB/s) 8GB card. The power supply is purpose bought from a Pi supplier, well able to supply the needs of the motherboard, and I'm using a Logitech wired keyboard and wireless mouse which seem to work (though the mouse double click sensitivity needs to be adjusted; like many I'm under-impressed with the mouse characteristics of the Pi).

The whole thing is rather bizarre, and any insights people could offer would be welcome.

Roxysteve wrote:Briefly, I have added a bin directory to my home directory (the pi account) and added the path to the c++ include libraries to my .profile but neither the path to the bin directory (which should be added to the PATH env variable by legacy code in the .profile) nor the library path (which I added myself to the PATH setting in that .profile) are being appended/prepended to the PATH variable until I manually source the .profile, at which point everything works as expected.

How are you logging in? (Text console or GUI, manual or automatic, SSH, VNC.) Does the command "ps $$" show the COMMAND as "-bash", with a leading hyphen to denote a login shell?

I understand the role of the PATH variable. What I don't understand is why the .profile defined in $HOME/.profile isn't being sourced at login as it should be.

I do not have the files that would cause the .profile to be ignored defined under any account on the system, so that can't be the issue.

I *looks* like /etc/profile has been executed but not $HOME/.profile

my additions to .profile are two lines, underneath the if clause that checks for the presence of a $HOME/bin directory, and they read:

PATH=$PATH:/usr/include/c++/4.6
export PATH

when this code, along with the legacy code in $HOME/.profile is sourced, it works as expected and I see the bin directory and the library directory properly listed as part of the PATH variable, but the code never seems to execute as part of the login process as it should do.

jojopi wrote:How are you logging in? (Text console or GUI, manual or automatic, SSH, VNC.) Does the command "ps $$" show the COMMAND as "-bash", with a leading hyphen to denote a login shell?

I am logging in as part of the boot process at first (the pi boots into the GUI as "pi") but also I've tried logging out and logging in again. No dice. I am not allowed to connect to the network here so I'm using the console.

That is not a login shell, so it does not source .profile. If you had logged in in text mode and run startx, then the parent shell would already have sourced .profile, but a GUI login may not include any login shells.

The Foundation's recent Raspbian images contain a workaround for this issue. Check if you have the file /etc/X11/Xsession.d/75source-profile and if not create it as root with these contents:

I double check for lunacy, absence of "export PATH" or anything else that occurs to me, but nothing seems obviously wrong. I ran exec startx in the futile hope it would change things but no.

C'est bizarre! It looks for all the world like the startx is provoking a fork that resources the PATH from the system rather than the user account no matter how the process is instructed to come into being. That can't be true, can it? 8o\

I would just like to thank everyone for supplying the know-how. The modification to 75source-profile worked beautifully once I had removed a line in the existing file properly (ahem).

Thanks for giving me much needed help. I am now in the process of reading the manuals, and I want to thank you all for clearing my immediate problem for me so I could actually begin to get a handle on the X technology. So much more helpful than in many other forums I've participated in over the years.

The only real reason I need the X desktop is that my poor old eyes, burned out from looking at Univac greenscreens for Lo! these many years, need the benefit of 18 point type and black type on white background.

Thank you for giving me back my development environment. I live for the day I can pay this forward.

My Pi has the workaround identified by jojopi, and X desktop terminals do pick up the PATH environment variable from ~/.profile. But X desktop terminals do not pick up my GOPATH environment variable which is also defined in ~/.profile. I would like each desktop terminal to be aware of GOPATH upon opening.

Edit: A solution I've found is to export the definition of GOPATH in ~/.bashrc. Each new X terminal window I open then already knows of GOPATH.