NetWorker: nsrexecd: error while loading shared libraries: libosysrtxml.so
Summary: NetWorker: nsrexecd: error while loading shared libraries: libosysrtxml.so: cannot open shared object file: No such file or directory.
Symptoms
Cannot start nsrexecd. Starting nsrexecd fails with:
# /usr/sbin/nsrexecd
/usr/sbin/nsrexecd: error while loading shared libraries: libosysrtxml.so: cannot open shared object file: No such file or directory
However, libosysrtxml.so is found on the Linux file system:
# find / -name libosysrtxml.so
/usr/lib/nsr/lib64/cst/libosysrtxml.so
/opt/lgtonmc/lib64/cst/libosysrtxml.so
/mnt/alt/x/usr/lib/nsr/libosysrtxml.so
Using ldd (List Dynamic Dependencies) to list the libraries that nsrexecd require, shows missing libraries:
# ldd /usr/sbin/nsrexecd
linux-vdso.so.1 => (0x00007fff1a5a5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007ffa9831b000)
libosysrtxml.so => not found
libCSP-LDAP.so => not found
libCSP-LDAPClient.so => not found
libCSP-lb.so => not found
libCSP-C.so => not found
libCSP-XML.so => not found
libCSP-RT.so => not found
libCSP.so => not found
libCSPI.so => not found
libCST-Admin.so => not found
librt.so.1 => /lib64/librt.so.1 (0x00007ffa9810e000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffa97ef1000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007ffa97bea000)
libm.so.6 => /lib64/libm.so.6 (0x00007ffa97971000)
libc.so.6 => /lib64/libc.so.6 (0x00007ffa975fa000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffa9852b000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ffa973e3000)
Cause
Resolution
1) Start the NetWorker processes through the startup script /etc/init.d/networker.
The startup script has the definition for the required libraries and the path to the executable, in order for the NetWorker daemons to run.
# networkerrc defines environment variables, such as LD_LIBRARY_PATH, required.
# to run NetWorker daemons.
NETWORKERRC=/opt/nsr/admin/networkerrc
Looking at networkerrc --
# pwd
/opt/nsr/admin/networkerrc
# Define the environment variables required to run NetWorker daemons.
# End-users should not modify this file to add user environment variables.
# This file is removed automatically upon package removal.
#
# cst path is required to locate dynamic libraries of cst (also loads internal bsafe crypto libraries).
# It must be the first entry of LD_LIBRARY_PATH otherwise it fails to load libraries.
# cst comes with its own bsafe library. cst bsafe library version may or may not be the same
# version of bsafe library used by other components in the product.
## this is where the library paths are defined ###
linux86w)
NSR_LIBS=/usr/lib/nsr/lib64/cst:/usr/lib/nsr/lib64
;
2) If the startup script is not used, it is required to export the library locations using LD_LIBRARY_PATH prior to starting nsrexecd.
# export LD_LIBRARY_PATH=/usr/lib/nsr/lib64/cst:/usr/lib/nsr/lib64
2.1) Run ldd. It should find all the dependent libraries.
# ldd /usr/sbin/nsrexecd
linux-vdso.so.1 => (0x00007ffd2fc72000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f41e8660000)
libosysrtxml.so => /usr/lib/nsr/lib64/cst/libosysrtxml.so (0x00007f41e84ab000)
libCSP-LDAP.so => /usr/lib/nsr/lib64/cst/libCSP-LDAP.so (0x00007f41e832d000)
libCSP-LDAPClient.so => /usr/lib/nsr/lib64/cst/libCSP-LDAPClient.so (0x00007f41e8100000)
libCSP-lb.so => /usr/lib/nsr/lib64/cst/libCSP-lb.so (0x00007f41e7fd9000)
libCSP-C.so => /usr/lib/nsr/lib64/cst/libCSP-C.so (0x00007f41e7e26000)
libCSP-XML.so => /usr/lib/nsr/lib64/cst/libCSP-XML.so (0x00007f41e7bfe000)
libCSP-RT.so => /usr/lib/nsr/lib64/cst/libCSP-RT.so (0x00007f41e7a8f000)
libCSP.so => /usr/lib/nsr/lib64/cst/libCSP.so (0x00007f41e78fe000)
libCSPI.so => /usr/lib/nsr/lib64/cst/libCSPI.so (0x00007f41e779c000)
libCST-Admin.so => /usr/lib/nsr/lib64/cst/libCST-Admin.so (0x00007f41e765c000)
librt.so.1 => /lib64/librt.so.1 (0x00007f41e7453000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f41e7236000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f41e6f2d000)
libm.so.6 => /lib64/libm.so.6 (0x00007f41e6cb4000)
libc.so.6 => /lib64/libc.so.6 (0x00007f41e6938000)
/lib64/ld-linux-x86-64.so.2 (0x00007f41e889a000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f41e6720000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f41e6509000)
2.2) Now start nsrexecd.
# /usr/sbin/nsrexecd
# ps -fe | grep nsr
root 46630 1 0 23:43 ? 00:00:00 /usr/sbin/nsrexecd
root 46640 45042 0 23:43 pts/0 00:00:00 grep nsr