LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-12-2018, 08:59 AM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Location: SATX
Distribution: RHEL/CentOS
Posts: 1,301
Blog Entries: 4

Rep: Reputation: 148Reputation: 148
Question How to tell what programs are using LD_LIBRARY?


I'm hardening a RHEL system and have found the following:

Code:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
I found this:

http://xahlee.info/UnixResource_dir/_/ldpath.html

Quote:

X11 uses LD_LIBRARY_PATH during its build process. X11 distributes its fonts in “bdf” format, and during the build process it needs to “compile” the bdf files into “pcf” files. LD_LIBRARY_PATH is used to point the build lib directory so it can run bdftopcf during the build stage before the shared libraries are installed.

If I look at root PATH, there is X11R6, which I what I'm thinking, however I want to be sure, as I'm not really familiar with LD_LIBRARY.

Here are some of the URLs that I've looked at:

https://unix.stackexchange.com/quest...h-env-variable

http://tldp.org/HOWTO/Program-Librar...libraries.html

Last edited by JockVSJock; 01-12-2018 at 09:04 AM.
 
Old 01-12-2018, 10:26 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
Code:
# for seeing if LD_LIBRARY_PATH is used and its content
strings /proc/<pid of program>/environ | grep LD_LIBRARY_PATH

# or just for true / false testing
grep LD_LIBRARY_PATH /proc/<pid of program>/environ
 
Old 01-12-2018, 12:02 PM   #3
JockVSJock
Senior Member
 
Registered: Jan 2004
Location: SATX
Distribution: RHEL/CentOS
Posts: 1,301

Original Poster
Blog Entries: 4

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by keefaz View Post
Code:
# for seeing if LD_LIBRARY_PATH is used and its content
strings /proc/<pid of program>/environ | grep LD_LIBRARY_PATH

# or just for true / false testing
grep LD_LIBRARY_PATH /proc/<pid of program>/environ
Well I suspect that it is X11, however when I try to grep on that PID, it changes.

So I'm not sure if there is a better way to track this down.

I did try:

Code:
strings /proc/12108/environ | grep LD_LIBRARY_PATH

strings: '/proc/121808/environ': No such file
Unless you mean the word "strings" is substituted with something else like "X11R6" .

thanks
 
Old 01-12-2018, 12:20 PM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
No, it's " strings " command

Maybe try
Code:
ls /proc/12108/environ
...before, it seems the error is a "file not found error"
It's possible that you got a wrong number as pid

To get X11 pid, try
Code:
pgrep X
Infos on /proc/<pid>
https://access.redhat.com/documentat...oc-processdirs

Last edited by keefaz; 01-12-2018 at 12:28 PM.
 
Old 01-12-2018, 12:24 PM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,505

Rep: Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314
I think all of the binaries which have dynamically linked libraries will use that, because dlopen will handle it.
in general LD_LIBRARY_PATH cannot be used during build, it is used (only) when you start an application. The link you posted is more than 10 years old and definitely (was) not the intended way...

Last edited by pan64; 01-12-2018 at 12:27 PM.
 
  


Reply

Tags
ld_library, rhel, x11r6


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
Linux Mint 2382 programs v. Debian 57991 programs grumpyskeptic Linux - Software 3 12-04-2016 04:01 PM
[SOLVED] KDE 4 - Weird skewed colors in qt4 programs after launching gtk programs. genericflounder Linux - Desktop 3 08-25-2010 05:41 PM
Programs installed with package manager aren't recognised by other programs fraserm Linux - Software 3 04-21-2007 01:38 PM
PKG_CONFIG and LD_LIBRARY problems web250 Mandriva 1 06-24-2005 09:53 AM
my table with programs when i press in button (left down corner) do no show programs sagi7ario Mandriva 1 03-12-2004 01:02 PM

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

All times are GMT -5. The time now is 01:39 PM.

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