Interview Prep/Linux/Processes, memory and OOM

An app installed in `/opt/app/lib` can't find its own libraries even though they're there.

IntermediateTroubleshootingProcesses, memory and OOM
Answer

Likely causes → /opt/app/lib isn't in the dynamic linker's search path, and the binary has no RPATH.

Diagnose →

ldd /opt/app/bin/app
readelf -d /opt/app/bin/app | grep -Ei 'rpath|runpath'

Fix → Add /opt/app/lib to /etc/ld.so.conf.d/app.conf and run sudo ldconfig, or set Environment=LD_LIBRARY_PATH=/opt/app/lib in the service unit.

Prevent → Package apps with proper RPATH or a wrapper script.

All Linux questions Roadmap: Linux

More on Processes, memory and OOM