Chrooted PHP-FPM Debian 6 - DNS resolving
I'm trying to get a chrooted PHP-FPM environment working with DNS resolving. This is all it needs, no need for mail or other things. It's a Debian 6 32-bit install.
I tried copying the following:
/lib/i386-linux-gnu/i686/cmov
-> /chroot/lib/i386-linux-gnu/i686/cmov
libdl-2.13.so libm-2.13.so libnsl-2.13.so libnsscompat-2.13.so libnssfiles-2.13.so libnss_nis-2.13.so libresolv-2.13.so librt-2.13.so
Also copied created a dev/urandom and etc/nsswitch.conf and etc/resolv.conf
Still does not seem to be working. I did try copying the files in the cmov directory to /chroot/lib/ directly but this did not work either.
Are there any other files that I need?
Thanks!
1 Reply
Got it working, for whoever may need this in the future, I now have the following files in the chrooted env:
/dev/urandom (command to create, mknod -m 644 dev/urandom c 1 9)
/etc/:
total 52K
drwxr-xr-x 2 root root 4.0K Apr 17 15:34 .
drwxr-xr-x 10 root root 4.0K Apr 17 15:46 ..
-rw-r--r-- 1 root root 9 Apr 17 15:34 host.conf
-rw-r--r-- 1 root root 351 Apr 17 14:15 hosts
-rw-r--r-- 1 root root 26K Apr 17 15:27 ld.so.cache
-rw-r--r-- 1 root root 2.6K Apr 17 15:33 locale.alias
-rw-r--r-- 1 root root 127 Apr 17 14:15 resolv.conf
/lib/i386-linux-gnu/
total 36K
drwxr-xr-x 3 root root 4.0K Apr 17 15:28 .
drwxr-xr-x 3 root root 4.0K Apr 17 15:27 ..
drwxr-xr-x 3 root root 4.0K Apr 17 15:27 i686
-rw-r--r-- 1 root root 22K Apr 17 15:28 libnss_dns.so.2
/lib/i386-linux-gnu/i686/cmov/
total 32K
drwxr-xr-x 2 root root 4.0K Apr 17 15:29 .
drwxr-xr-x 3 root root 4.0K Apr 17 15:27 ..
-rw-r--r-- 1 root root 22K Apr 17 15:29 libnss_dns.so.2
/usr/share/locale/
total 12K
drwxr-xr-x 2 root root 4.0K Apr 17 15:33 .
drwxr-xr-x 3 root root 4.0K Apr 17 15:31 ..
-rw-r--r-- 1 root root 2.6K Apr 17 15:33 locale.alias
/var/lib/
total 68K
drwxr-xr-x 3 root root 4.0K Apr 17 13:30 .
drwxr-xr-x 3 root root 4.0K Apr 17 13:28 ..
drwx-wx-wt 2 root root 56K Apr 17 16:00 php5
I actually think the locale files aren't needed for the DNS, but it is for the specific application I run. Same with /var/lib/php5, so I haven't included the contents of that directory.
Hopefully it'll help someone in the future!