LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   missing libraries every time i run a command (except cd) (https://www.linuxquestions.org/questions/linux-software-2/missing-libraries-every-time-i-run-a-command-except-cd-694076/)

starkes 12-31-2008 10:49 AM

missing libraries every time i run a command (except cd)
 
Hi,

I have a centos 5 installation up and running, and everything seems good except...

One user account is having a major problem. If you try to run any command or program, it says there's a missing library.

The particular library missing is different for each program you try to use, but it seems almost like when under this user none of the library folders are getting sourced... or something..


has anyone seen a problem like this?


Thanks.

i92guboj 12-31-2008 12:36 PM

No, but check your shell initialization files, in case that any of them is overriding LD_LIBRARY_PATH or something like that. For example, if you use bash you should check ~/.bashrc, ~/.bash_profile, ~/.bash_login and ~/.profile. For other shells read their man page to know where to look.

If this happens only for one user that's the only advice I can give you.

PTrenholme 12-31-2008 02:09 PM

Have the user do an echo $PATH and see if it shows what you expect it to show. (If the user is unable to open a terminal window, you can have the user try a Ctrl-Alt-F3 and log in to tty3 to do the echo.) Following i92guboj's advice would be good, but, obviously, check for PATH= statements. I suspect that the user may have some script, perhaps not even one of the standard .bash* ones, that exports a PATH but neglects to concatenate $PATH to the value being exported.

You might also want to look for something "special" in /etc/rc.d/rc.local for the problem user.

i92guboj 12-31-2008 02:16 PM

PTrenholme, in that case it wouldn't be able to find the executable programs, and the error would be something in the lines of "command not found". However it seems that the problem is that it can't find libraries. The bin directories rarely contain a library. On a similar way, the lib directories never appear in PATH. So, this command will return nothing in any system if you try it.

Code:

# echo $PATH|grep lib
In other order of things, I believe it's something to do with the shell initialization files because:
  • the shell itself works fine
  • the rest of users have no problem
  • cd, which usually is a shell builtin, works ok

jailbait 12-31-2008 04:25 PM

i92guboj is on the right track. Linux keeps the names of the libraries in a file called /etc/ld.so.conf which applies to all users. In CentOS /etc/ld.so.conf references a directory called /etc/ld.so.conf.d where it keeps the actual list. This list is used for all users and root. In my CentOS /etc/ld.so.conf.d contains two files:

/etc/ld.so.conf.d/i486-linux-gnu.conf which contains:
Code:

    # Multiarch support
    /lib/i486-linux-gnu
    /usr/lib/i486-linux-gnu

/etc/ld.so.conf.d/libc.conf which contains:
Code:

    # libc default configuration
    /usr/local/lib

Since most of your users have no problem finding the standard libraries there is probably nothing wrong with the library configuration files in your /etc. But you should check them first to make sure they are correct.

If they are correct then the question is why is the one user account unable to access the standard libraries. A user can modify the library list. They do so by setting the LD_LIBRARY_PATH variable. Have the user who is having problems issue this command to check his LD_LIBRARY_PATH variable:

echo $LD_LIBRARY_PATH

If the LD_LIBRARY_PATH variable hasn't been touched then you should get a null response. If the LD_LIBRARY_PATH contains some data then the problem is an incorrectly set LD_LIBRARY_PATH.

-------------------------
Steve Stites


All times are GMT -5. The time now is 11:49 PM.