On 2021-07-17, Kent Watsen <k...@watsen.net> wrote: > Thanks Theo! > > >> It seems you copied libjq and libonig into usr/local/lib in the chroot. >> By default, ld.so only looks for shared objects in /usr/lib, so it can't >> find them. >> >> # env LD_LIBRARY_PATH=/usr/lib:/usr/local/lib chroot /var/www >> /usr/local/bin/jq --version >> >> should work. > > Indeed it did. Shorter: > > env LD_LIBRARY_PATH='/usr/local/lib:$LD_LIBRARY_PATH' /usr/local/bin/jq > --version > > >> Chrooting to / works because rc(8) runs ldconfig(8) to add >> /usr/local/lib and /usr/X11R6/lib if they're present. >> >> You can copy all the libraries into /var/www/usr/lib, you can set >> LD_LIBRARY_PATH=/usr/local/lib:/usr/, or you can run ldconfig in the >> chroot. >> >> Read ld.so(1) and ldconfig(8)for more details. > > Yes, setting `ldconfig -n /usr/local/lib` is a more sticky option. > > The `env` approach seems best when just one `jq` command, whereas the > `ldconfig` approach seems better when there is more than one `jq` command...
Copying the various libraries to /var/www/usr/lib is pretty straightforward. Remember they might need updating, I copy them from rc.local so I don't forget.