Friday, September 16, 2011

monit: fatal: /usr/sfw/lib/libfl-2.5.4.so.0: wrong ELF class: ELFCLASS32

Monit Solaris 10 5/9 64 bits installation went good but it was not working:

monit: fatal: /usr/sfw/lib/libfl-2.5.4.so.0: wrong ELF class: ELFCLASS32

A simple ldd showed the library was not 64bits:
# ldd /usr/local/bin/monit
        libfl-2.5.4.so.0 =>      /usr/sfw/lib/libfl-2.5.4.so.0  - wrong ELF class: ELFCLASS32
        libpam.so.1 =>   /lib/64/libpam.so.1
        libpthread.so.1 =>       /lib/64/libpthread.so.1
        libresolv.so.2 =>        /lib/64/libresolv.so.2
        libnsl.so.1 =>   /lib/64/libnsl.so.1
        libsocket.so.1 =>        /lib/64/libsocket.so.1
        libkstat.so.1 =>         /lib/64/libkstat.so.1
        libssl.so.0.9.7 =>       /usr/sfw/lib/libssl.so.0.9.7  - wrong ELF class: ELFCLASS32
        libcrypto.so.0.9.7 =>    /usr/sfw/lib/libcrypto.so.0.9.7  - wrong ELF class: ELFCLASS32
        libc.so.1 =>     /lib/64/libc.so.1
        libcmd.so.1 =>   /lib/64/libcmd.so.1
        libmp.so.2 =>    /lib/64/libmp.so.2
        libmd.so.1 =>    /lib/64/libmd.so.1
        libscf.so.1 =>   /lib/64/libscf.so.1
        libdoor.so.1 =>  /lib/64/libdoor.so.1
        libuutil.so.1 =>         /lib/64/libuutil.so.1
        libgen.so.1 =>   /lib/64/libgen.so.1
        libm.so.2 =>     /lib/64/libm.so.2


Here is how you solve these kind of issues in your 64 bits Solaris box:
export LD_LIBRARY_PATH=/usr/sfw/lib/64:$LD_LIBRARY_PATH

However you better use crle in this case as you want the change to affect your whole system, after all this is a 64 machine ins't it?

crle -64 -u -l /usr/sfw/lib/64

2 comments:

Luis Roman said...

Hi,
you can helpme.
Please you check which lib is not 64 bit.
but if show one how 32 bit, how you create for 64bit?
thank a lot.

sorry for my english.

Nestor Urquiza said...

Luis, what you do is just to include your path to the 64 bits library in the LD_LIBRARY_PATH environment variable as explained in this post. So you do not create the library for 64 bits, on the contrary you include it. If it is not anywhere in your system you should then install it. Cheers,
- Nestor

Followers