Solved

LD_LIBRARY_PATH global settings

Posted on 1998-10-02
11
1,132 Views
Last Modified: 2013-12-27
I want to add to the LD_LIBRARY_PATH of all users on the
system (or at least cause the system to look in additional
directories besides /usr/lib with or without the
LD_LIBRARY_PATH environment variable).

I need to do this even for users who don't have a shell
(e.g.: user nobody).  That means I can NOT use /etc/.login
to set the LD_LIBRARY_PATH environment variable for all
users.

I need to do this on Solaris 2.5.1 and Solaris 2.6.  Is
there an /etc config file that will let me set the search
path for shared libraries on these operating systems, and
if so how do I set it up?

-Barry M. Caceres
0
Comment
Question by:barryc
11 Comments
 
LVL 1

Expert Comment

by:szetoa
ID: 2007182
Try setting the LD_LIBRARY_PATH in /etc/.profile.
0
 

Author Comment

by:barryc
ID: 2007183
Will that work if the user doesn't have a shell??? Doesn't
"sh" source the /etc/.profile, and therefore don't you need
a shell?  

I need this to work for user "nobody" whom the web server runs
as.  BUT, "nobody" does not have a shell.

0
 

Author Comment

by:barryc
ID: 2007184
Giving "nobody" a shell is NOT an option for security reasons.

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2007185
If they don't have a shell, where do they need then this variable?
0
 

Author Comment

by:barryc
ID: 2007186
I don't necessarily need the variable.  I need programs that
are run as "nobody" to be able to load dynamic libraries in
a non-standard directory (ie: not in /usr/lib).

The web server runs as "nobody" and all cgi programs in turn
run as nobody.  If these cgi programs need a shared library
that are not in /usr/lib then I want them to be able to find
them.

I need a solution that does NOT involve copying or linking the
libraries to /usr/lib or /usr/local/lib.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:barryc
ID: 2007187
Adjusted points to 350
0
 
LVL 2

Expert Comment

by:mlev
ID: 2007188
You could compile your CGI programs with the -R option, then they wouldn't need LD_LIBRARY_PATH to find the libraries.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2007189
didn't

   $ENV{'LD_LIBRARY_PATH'} .= ":/your/path";


work?
0
 
LVL 3

Expert Comment

by:braveheart
ID: 2007190
Any programs which need to be run can be wrapped in a shell wrapper which actively sets LD_LIBRARY_PATH. Alternatively, you can always link your programs in such a way that they can find the appropriate DLLs.  man ld.
0
 
LVL 4

Expert Comment

by:jos010697
ID: 2007191
Why not create a (symbolic) link in /usr/lib, pointing to your .so files?

kind regards,

Jos aka jos@and.nl
0
 
LVL 1

Accepted Solution

by:
ksb earned 350 total points
ID: 2007192
If you really want to fix this you can.  What ever is starting the processes that run as "nobody" needs to have the environment variable in question set.  For example "inetd" might be the process.

Find the start of the daemon in /etc/init.d/* and add a line to set LD_LIBRARY_PATH at the start of the daemon.  If you really want to go nuts replace /etc/init (after you move it to /etc/Init) with a C program that sets the environment the way you like it and evecve's the real init.  This is wacko dangerous on a Vendor system (easy if you have source to init).

On FreeBSD thete is a login.conf that lets you set $VARs for everyone.

-- ksb
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linux : can't create transaction lock error 1 57
LINUX ZIP - UNCOMPRESS WINDOWS PATH 3 86
Write an app 10 66
How to Insert a File Using Text Editor 9 79
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now