Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

LD_LIBRARY_PATH global settings

Posted on 1998-10-02
11
Medium Priority
?
1,160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 

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 1050 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

670 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