fanesto_postesio
fanesto_postesio

Reputation: 1

library not found running as root

I'm trying to run an executable as root to reduce its niceness under 0. When I try to run this executable as normal user the execution flows as expected, but if I run it as root (either using sudo or a root terminal) it cannot find a shared library. The library is in a directory under /home/user. Any suggestion as to why this is happening and how to solve? Thanks!

Upvotes: 0

Views: 822

Answers (2)

Veger
Veger

Reputation: 37915

You can use the LD_LIBRARY_PATH environment variable to let the application know where to look for dynamic libraries.

So add your custom location (/home/user/path/to/lib) to this environment variable.

Upvotes: 0

Pierre Arlaud
Pierre Arlaud

Reputation: 4131

You could:

  • Move the library to a more common place
  • Add /home/user in the root $LD_LIBRARY_PATH environment variable (e.g. by adding it in /root/.bashrc)

Upvotes: 1

Related Questions