Setuid processes limit the use of LD_PRELOAD (and some other variables) due to security concerns.
The loaded library should be specified only by name and be in one of the directories listed in /etc/ld.so.conf (see, for example, this link ), for example, on Debian-based systems
sudo cp library.so /usr/lib/x86_64-linux-gnu LD_PRELOAD=library.so daemon
Another approach is the full library path to /etc/ld.so.preload :
sudo echo path/to/library.so >> /etc/ld.so.preload
but then it will be preloaded to all new processes (which has a high probability of hacking the system if you are not very careful).
source share