Re: LD_LIBRARY_PATH



Ewan Mellor wrote:
On Sun, Apr 24, 2005 at 12:03:23PM -0400, Josh Babcock wrote:


At first I thought that I was experiencing a known problem with ssh-agent, but when I removed it from my .xsession file the problem didn't go away. Before running xinit, my LD_LIBRARY_PATH is set exactly as it was in my profile, but when I open a shell from within sawfish LD_LIBRARY_PATH is unset, completely absent. This is causing me a lot of problems. I can get around it by setting LD_LIBRARY_PATH in my .bashrc file, but that is an ugly hack and will undoubtedly cause confusion down the line. I really want to be able to set this variable in my .profile and not have to worry about it.


It will depend upon how your distro sets up xinit, but I think the consensus
these days is that your X session is a proper login session, and that the
environment for that is controlled by your ~/.xsession, /etc/X11/Xsession,
etc.  In other words, it's down to those files to set things like
LD_LIBRARY_PATH, not .profile, as in an X environment you can't guarantee that
someone is inside a shell.

It sounds like your xinit is throwing away the current environment and
starting clean, so you want to explicitly source ~/.bash_profile inside your
~/.xsession.  Depending upon your distro, there might be somewhere sensible
and system-wide to put these settings too.

HTH,

Ewan.



No, the variables are ok in .xsession. I put an echo statement on the line before sawfish, and it showed exactly what I had set in .profile (my .xsession sources .profile first thing anyway). Once sawfish starts up though, all it's child processes have the complete environment minus LD_LIBRARY_PATH including stuff that is only set in my .profile. I have tried substituting for the terminal program and the shell, and sawfish was the only common factor. Is it possible that something in my .sawfishrc is doing this? The string LD_LIBRARY_PATH doesn't occur in that file.

Josh



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