The 'ls' command, run as the 'oracle' user, reports `No such file or directory` with various shared libraries.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5.8
  • Oracle Applications

Issue

  • In a particular instance, the following is reported by ls only when accessing the 'oracle' user.
[root@<hostname> oracle]# su - oracle
[oracle@<hostname> ~]$ ls
ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
  • Other users on the system do not report any shared library files missing.

Resolution

  • Inside of the Oracle users ~/.bash_profile alter the LD_ASSUME_KERNEL to the following:
LD_ASSUME_KERNEL=2.6.18
export LD_ASSUME_KERNEL
  • su to the user and verify correct operation.

Root Cause

  • The LD_ASSUME_KERNEL environment variable set incorrectly in the users ~/.bash_profile file.

Diagnostic Steps

  • Verify that the issue only occurs for a single user when using ls
  • Verify that the ldd command for the individual user reports missing libraries whereas the 'root' user will display the correct libraries as shown below:
[root@<hostname> oracle]# ldd /bin/ls
        linux-vdso.so.1 =>  (0x00007fff249fd000)
        librt.so.1 => /lib64/librt.so.1 (0x00000032b5c00000)
        libacl.so.1 => /lib64/libacl.so.1 (0x00000032b5800000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00000032b6000000)
        libc.so.6 => /lib64/libc.so.6 (0x00000032b4800000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00000032b5400000)
        /lib64/ld-linux-x86-64.so.2 (0x00000032b4400000)
        libattr.so.1 => /lib64/libattr.so.1 (0x00000032b9800000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00000032b4c00000)
        libsepol.so.1 => /lib64/libsepol.so.1 (0x00000032b6400000)
[root@<hostname> oracle]# su - oracle
[oracle@<hostname> ~]$ ldd ls
/bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments