LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-13-2011, 06:01 AM   #1
shaen777
LQ Newbie
 
Registered: Dec 2009
Posts: 11

Rep: Reputation: 0
Why I can't store LD_LIBRARY_PATH in profile ?


Hi,

I can't store LD_LIBRARY_PATH in /etc/profile. After restart the variable is empty. All OK with any other variable, for example INFORMIXDIR, but not with LD_LIBRARY_PATH.
If I use EXPORT command in the console all OK. I'm using Ubuntu 10.04. What's wrong?
 
Old 04-13-2011, 06:20 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Are you sure you add:
Code:
export LD_LIBRARY_PATH=/some/path:/some/other/path
in /etc/profile and it's not unset by some settings in .profile?
 
Old 04-13-2011, 06:35 AM   #3
shaen777
LQ Newbie
 
Registered: Dec 2009
Posts: 11

Original Poster
Rep: Reputation: 0
yes, I'm sure. It looks like something unset this variable. I also tried to set in .profile, the same result. Any other variable works fine.
 
Old 04-13-2011, 07:04 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Just tested on an Ubuntu server (no X) and it works. In fact I can set it either through /etc/profile, /etc/bash.bashrc or in a file /etc/profile.d/ld_library.sh

Reading this, looks like it's unset when gdm starts. There are 2 workarounds (posts #17 and #21) there, so try any of them and see if you manage to keep the variable set.
 
1 members found this post helpful.
Old 04-13-2011, 07:22 AM   #5
shaen777
LQ Newbie
 
Registered: Dec 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Dear bathory, thank you for your prompt and quick response. Post 17 from your link resolved my problem.
 
Old 04-14-2011, 02:32 AM   #6
shaen777
LQ Newbie
 
Registered: Dec 2009
Posts: 11

Original Poster
Rep: Reputation: 0
LD_LIBRARY_PATH is still empty in xterm. How to store the variable for xterm too?
PATH is OK in xterm but not LD_LIBRARY_PATH.

Last edited by shaen777; 04-14-2011 at 02:35 AM.
 
Old 04-14-2011, 03:08 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Does this happen only for xterm, or for other terminals too? I don't get it. If the variable is set globally, how can it be unset per application.
Anyway you can create an alias
Code:
alias xterm='LD_LIBRARY_PATH=/some/path:/other/path /usr/bin/xtern'
 
Old 04-14-2011, 03:20 AM   #8
shaen777
LQ Newbie
 
Registered: Dec 2009
Posts: 11

Original Poster
Rep: Reputation: 0
where can I type it? in the console or store in some file? I checked only xterm and terminal. terminal is OK.

Last edited by shaen777; 04-14-2011 at 03:22 AM.
 
Old 04-14-2011, 03:42 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If you want to set it only for you, you can put it in ~/.bashrc. In general in /etc/bash.bashrc, but you should check if it works
 
Old 04-14-2011, 04:56 AM   #10
shaen777
LQ Newbie
 
Registered: Dec 2009
Posts: 11

Original Poster
Rep: Reputation: 0
thanks for the idea, but it doesn't work for me

I've added

alias xterm='LD_LIBRARY_PATH=/mypath1:/mypath2 /usr/bin/xterm'

to ~/.bashrc

LD_LIBRARY_PATH still empty in xterm.
Any other variables are OK - PATH, ORACLE_HOME, etc.

Last edited by shaen777; 04-14-2011 at 05:05 AM.
 
Old 04-14-2011, 05:24 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Another ubuntu "bug"! Solution on post #3 (remove suid/sgid)
 
1 members found this post helpful.
Old 04-14-2011, 05:46 AM   #12
shaen777
LQ Newbie
 
Registered: Dec 2009
Posts: 11

Original Poster
Rep: Reputation: 0
thanks for the link, how can I remove the s-flags from xterm?
 
Old 04-14-2011, 06:21 AM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Run either one:
Code:
chmod -s /usr/bin/xterm
chmod 755 /usr/bin/xterm

Last edited by bathory; 04-14-2011 at 05:15 PM.
 
1 members found this post helpful.
Old 04-14-2011, 06:30 AM   #14
shaen777
LQ Newbie
 
Registered: Dec 2009
Posts: 11

Original Poster
Rep: Reputation: 0
BIG THANKS!!!
it works!!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Information store: What software could I use to store and access various info merixon Linux - Software 2 12-17-2008 11:51 AM
system profile vs user profile bonito SUSE / openSUSE 3 06-28-2006 01:02 PM
???? Ld_library_path ???? g452 Linux - Software 9 08-26-2004 03:00 PM
Ld_library_path barrys Mandriva 2 06-15-2004 12:19 PM
samba sometimes unable to store roaming profile lukas_z Linux - Networking 0 07-25-2003 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration