Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #182281 > unrolled thread

Setting LD_LIBRARY_PATH on a per-user basis during login

Started by"Martin R. Neuhaeusser" <post@marneu.com>
First post2017-06-18 14:20 +0200
Last post2017-06-19 15:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  Setting LD_LIBRARY_PATH on a per-user basis during login "Martin R. Neuhaeusser" <post@marneu.com> - 2017-06-18 14:20 +0200
    Re: Setting LD_LIBRARY_PATH on a per-user basis during login Greg Wooledge <wooledg@eeg.ccf.org> - 2017-06-19 15:00 +0200

#182281 — Setting LD_LIBRARY_PATH on a per-user basis during login

From"Martin R. Neuhaeusser" <post@marneu.com>
Date2017-06-18 14:20 +0200
SubjectSetting LD_LIBRARY_PATH on a per-user basis during login
Message-ID<tTHln-4Z4-7@gated-at.bofh.it>
Dear all,

I am trying to set the LD_LIBRARY_PATH environment variable during the
login process on a per user basis in Debian stretch. According to the
documentation here https://wiki.debian.org/EnvironmentVariables,
it should be enough to set the environment variable in $HOME/.profile.

And this really works flawlessly for non-graphical logins. The first
bad thing that I had to realize is that for graphical logins, .profile
is just not read. As it seems, one has to source .profile in a (Debian-
specific) file which is called $HOME/.xsessionrc to ensure that
.profile is read during graphical logins.

Is it really expected behaviour that by default, all setting in
.profile are ignored for graphical logins whereas they are evaluated
for non-grahical ones?

But sadly, the story for setting LD_LIBRARY_PATH on a per-user basis
does not end here. And this leads me to my actual question:

Once I source $HOME/.profile from $HOME/.xsessionrc and login
graphically, all variables that I define within $HOME/.profile are set
as expected _except_ LD_LIBRARY_PATH. It seems that someone clears
exactly this variable (on purpose?) without caring at all about its
content. After some hours of trial-and-error, I finally gave up. Has
anyone else encountered this problem and knows a solution? I do not
even know which package to raise a bug report against...

It might be related to a similar discussion on Ubuntu:
https://stackoverflow.com/questions/13428910/how-to-set-the-environment
al-variable-ld-library-path-in-linux

I believe there are very good reasons to allow different users to
adjust the LD_LIBRARY_PATH according to their build environments and
local libraries. Why this variable is handled in such an exceptional
way only when logging in graphically, is hard to explain, I believe.

Any hints or help is highly appreciated.

Best regards,
Martin

[toc] | [next] | [standalone]


#182353

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2017-06-19 15:00 +0200
Message-ID<tU4rE-2KP-17@gated-at.bofh.it>
In reply to#182281
On Sun, Jun 18, 2017 at 01:52:05PM +0200, Martin R. Neuhaeusser wrote:
> it should be enough to set the environment variable in $HOME/.profile.
> 
> And this really works flawlessly for non-graphical logins.

For graphical (display manager) logins, see
<https://wiki.debian.org/Xsession>.

> The first
> bad thing that I had to realize is that for graphical logins, .profile
> is just not read. As it seems, one has to source .profile in a (Debian-
> specific) file which is called $HOME/.xsessionrc to ensure that
> .profile is read during graphical logins.

~/.xsessionrc does not exist by default, so it may or may not dot in
~/.profile.  Depends on what you put in it when you create it.

> Is it really expected behaviour that by default, all setting in
> .profile are ignored for graphical logins whereas they are evaluated
> for non-grahical ones?

Yup.

> Once I source $HOME/.profile from $HOME/.xsessionrc and login
> graphically, all variables that I define within $HOME/.profile are set
> as expected _except_ LD_LIBRARY_PATH. It seems that someone clears
> exactly this variable (on purpose?) without caring at all about its
> content.

Sounds like a desktop environment thing.  They are highly intrusive.
Just a few weeks ago, someone was trying to set their locale variables
at login, and GNOME was clobbering them.

> After some hours of trial-and-error, I finally gave up.

Which desktop environment are you using?  How attached to it are you?

Perhaps your DE has some mechanism for allowing "dangerous" variables
like LD_LIBRARY_PATH to be set by the end user.  Or perhaps it simply
"knows better" than you, and you will have to scrap it entirely to
achieve your goals.  Who knows?  Certainly not I.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web