When attempting to open up ports with setcap, LD_LIBRARY_PATH is unset
Issue
- Oracle binaries using their own libraries causes the LD_LIBRARY_PATH variable to unset when using "setcap"
- Attempting to use setcap but it did not work as it unset the executable's $LD_LIBRARY_PATH; which the program needs to run as it uses its own libraries.
[root@testsystem 64]# cd /app/dsee7/lib/64/
[root@testsystem 64]# file ns-slapd
ns-slapd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped
[root@testsystem 64]#
[root@testsystem 64]# setcap 'cap_net_bind_service=+ep' /app/dsee7/lib/64/ns-slapd
[root@testsystem 64]# getcap /app/dsee7/lib/64/ns-slapd
/app/dsee7/lib/64/ns-slapd = cap_net_bind_service+ep
[root@testsystem 64]# su - appuser
[appuser@testsystem ~]$ /app/dsee7/bin/dsadm start /app/slapd-testsystem/
/app/dsee7/lib/64/ns-slapd: error while loading shared libraries: libslapd.so: cannot open shared object file: No such file or directory
Command /app/dsee7/lib/64/ns-slapd -D /app/slapd-testsystem -i /app/slapd-testsystem/logs/pid failed: error 127
Failed to start Directory Server instance '/app/slapd-testsystem'
[appuser@testsystem ~]$ logout
[root@testsystem 64]# setcap -r /app/dsee7/lib/64/ns-slapd
[root@testsystem 64]# ldd /app/dsee7/lib/64/ns-slapd |grep libslapd
libslapd.so => /app/dsee7/lib/64/libslapd.so (0x00007fb980832000)
[root@testsystem 64]#
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.