no shared objects can be found unless I am root

Inside a jail I want to run processes as a different user than root. When I am root I have no problems running them. If I make a new user and try and run the process though I get errors telling me that shared objects can not be found. It does not seem to be any specific shared object it actually seems to be that no shared objects at all can be found. How can I fix this so I can run processes as a non-root user? Thanks!
 
when run as non-root:

Code:
/libexec/ld-elf.so.1: Shared object "librt.so.1" not found, required by "php"

when run as root it works fine

Code:
ldd /usr/local/bin/php
/usr/local/bin/php:
	libcrypt.so.5 => /lib/libcrypt.so.5 (0x28301000)
	libpcre.so.0 => /usr/local/lib/libpcre.so.0 (0x2831a000)
	librt.so.1 => /usr/lib/librt.so.1 (0x28356000)
	libm.so.5 => /lib/libm.so.5 (0x2835b000)
	libxml2.so.5 => /usr/local/lib/libxml2.so.5 (0x28375000)
	libz.so.5 => /lib/libz.so.5 (0x2849f000)
	libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x284b1000)
	libc.so.7 => /lib/libc.so.7 (0x285a7000)

Code:
whereis librt.so.1
librt.so.1:

Code:
ls -al /usr/lib/librt.so.1
-r--r--r-- 1 root  wheel  16604 /usr/lib/librt.so.1

Please help this is driving me crazy =< ! Why on Earth would it be able to find it when I run as root but not when run as non-root? I mean the thing it is looking for is there so why can it not find it. It doesn't matter what I run btw no processes will work unless run as root, some library is always not found. Even though they are all right there.
 
Okay I fixed it, and will say how if some poor soul finds themselves in my situation and is about to smash their head into computer monitor. Maybe I can save them some medical bills ;-).

/data/jails/basejail/usr, /data/jails/basejail/usr/lib32, /data/jails/newjail/basejail, /data/jails/basejail

chmod all to 0755

Simple as that.
 
Back
Top