Non-system libssl.so is not properly loaded

Issue #365 invalid
Chi Man Lei created an issue

I tried to compiled monit v5.17.1 from source code with a non-system openssl by specifying configure options, --with-ssl-incl-dir and --with-ssl-lib-dir, on my linux development box:

Linux 3.10.0-229.20.1.el7.x86_64 #1 SMP Tue Nov 3 19:10:07 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

The installation ran smoothly without any issues and from the make output I could tell the ssl libraries were found correctly from the specified locations. However, when I tried to run the monit binary I got error below:

/opt/luban/env/development.uber/.luban/pkg/monit/versions/5.17.1/bin/monit -V
/opt/luban/env/development.uber/.luban/pkg/monit/versions/5.17.1/bin/monit: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory

then I ran "ldd" command and confirmed that monit couldn't find libssl properly:

ldd /opt/luban/env/development.uber/.luban/pkg/monit/versions/5.17.1/bin/monit
        linux-vdso.so.1 =>  (0x00007ffd1fd99000)
        libm.so.6 => /lib64/libm.so.6 (0x00007ff95f747000)
        libpam.so.0 => /lib64/libpam.so.0 (0x00007ff95f538000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff95f31b000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007ff95f0e4000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007ff95eeca000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x00007ff95ecb0000)
        libssl.so.1.0.0 => not found
        libcrypto.so.1.0.0 => not found
        libc.so.6 => /lib64/libc.so.6 (0x00007ff95e8ee000)
        libaudit.so.1 => /lib64/libaudit.so.1 (0x00007ff95e6c7000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007ff95e4c3000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff95fa51000)
        libfreebl3.so => /lib64/libfreebl3.so (0x00007ff95e2bf000)

I then tried installing monit with the system openssl and the installation was successfully, monit could run properly without any errors like above.

Therefore, I suspect the given ssl header and lib locations were not properly handled in run-time although they were used during compilation.

Feel free to let me know if you want me to provide extra information.

Thank you very much!

Chi

Comments (2)

  1. Tildeslash repo owner

    It is not monit issue - you just need to set the path to non-system library in loader (e.g. via LD_LIBRARY_PATH environment variable when executing monit).

    Other option is to link monit with static SSL library.

  2. Chi Man Lei reporter

    Thanks a lot for the quick reply! I didn't notice there was an option to link monit with static SSL library. Tried it and worked fine.

    Thanks again for the great support!

    Chi

  3. Log in to comment