LinuxQuestions.org
Review your favorite Linux distribution.
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 02-26-2008, 11:50 PM   #1
smallbook
Member
 
Registered: Jan 2008
Posts: 40

Rep: Reputation: 15
cannot export LD_LIBRARY_PATH


Hi everyone, i have a CentOS running on my personal PC. I exported LD_LIBRARY_PATH to a long list in my /etc/profile but whenever i echo it, it displays the result of LD_LIBRARY_PATH set in /etc/profile.d/ati*.sh file. When i executed an echo command after the export command in /etc/profile, it does set it to the path i wanted but somehow the .sh file in /etc/profile.d seems to not able to detect it and always sets it back to the default one, which is not sufficeint for my application to run. Is there bug that somehows disallow .sh from detecting the export command in /etc/profile?
 
Old 02-27-2008, 12:15 AM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
I'm not familiar with CentOS at all but, if /etc/profile.d/ scripts are run after /etc/profile (which they pretty much have to be) and a script in there does 'LD_LIBRARY_PATH=foo' rather than 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:foo' like it should, that could explain it.
 
Old 02-27-2008, 12:37 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,395

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
Well, a .sh file (/etc/profile.d/ati*.sh) is just text, so why don't you read it and find out?
Alternatively, set it the way you want it in your .bash_profile .
 
Old 02-27-2008, 03:03 AM   #4
smallbook
Member
 
Registered: Jan 2008
Posts: 40

Original Poster
Rep: Reputation: 15
Hi digiot is correct, the ati*.sh file set it to $LD_LIBRARY_PATH:/foo but there is an if else loop where it will try to detect if there is any initial setting of LD_LIBRARY_PATH in any other files, if there isn't it just sets to LD_LIBRARY_PATH to /foo instead of $LD_LIBRARY_PATH:/foo. That i can alter but when i try to start some programmes on the desktop (icons), it will only detect the incorrect or incomplete LD_LIBRARY_PATH, which is the one in ati*.sh, unless i modify it to jz set it directly to $LD_LIBRARY_PATH:/foo without checking if it can detect a preset LD_LIBRARY_PATH but isnt' that cheating? Why doesn't it detect the LD_LIBRARY_PATH set in /etc/profile?
 
Old 02-27-2008, 04:27 AM   #5
harsshal
Member
 
Registered: Jul 2006
Location: New York, NY
Distribution: redhat,ubuntu,RHEL,fedora,centOS
Posts: 105

Rep: Reputation: 15
~/.bashrc

bash_profile executes this file.you can try in that file too..
 
Old 02-27-2008, 05:57 AM   #6
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Quote:
Originally Posted by smallbook View Post
Hi digiot is correct, the ati*.sh file set it to $LD_LIBRARY_PATH:/foo but there is an if else loop where it will try to detect if there is any initial setting of LD_LIBRARY_PATH in any other files, if there isn't it just sets to LD_LIBRARY_PATH to /foo instead of $LD_LIBRARY_PATH:/foo. That i can alter but when i try to start some programmes on the desktop (icons), it will only detect the incorrect or incomplete LD_LIBRARY_PATH, which is the one in ati*.sh, unless i modify it to jz set it directly to $LD_LIBRARY_PATH:/foo without checking if it can detect a preset LD_LIBRARY_PATH but isnt' that cheating? Why doesn't it detect the LD_LIBRARY_PATH set in /etc/profile?
I didn't follow all of that. Like chrism01 and harsshal say, you can set it in your personal initialization files which are guaranteed to kick in after the systemwide stuff. If you need it for all users, you *could* put it in /etc/skel/.bash_profile (or the equivalent) but that would only work for new users, could be accidentally deleted, etc. So you probably want it in /etc/profile.

As far as the desktop icon stuff, I'm not sure what you mean, but you will have to restart X for stuff like that to kick in.

As far as cheating, I don't think so - something's broke; fix it. That's fair.

As far as why the script is goofing up, I dunno - what is the exact test it's performing? When does it get read vs. where you set your path? Hard to tell from this far away.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Ld_library_path? lbdgwgt Linux - Newbie 2 11-13-2006 05:08 AM
export LD_LIBRARY_PATH Pedroski Linux - Software 7 01-01-2005 04:06 AM
Permanently Set a Export Setting (LD_LIBRARY_PATH) nistelrooy Linux - General 1 11-25-2004 11:33 AM
Ld_library_path fng_#1 Linux - Software 4 09-19-2004 11:33 PM
Ld_library_path barrys Mandriva 2 06-15-2004 12:19 PM

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

All times are GMT -5. The time now is 05:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration