As an alternately to my real question: does anyone know of a simple command line tool to make a chroot jail? I'm thinking something that will run a command and copy everything it needs to run into a given directory. I saw some directions for a tool but it had config files and seemed to be expecting me to launch it from X and neither of those work for my case.
And for the real question:
I'm trying to build a chroot jail and it's not working. This is what I get when I strace the command:
bcs@builder:~/dmd$ sudo strace sudo chroot /home/bcs/dmd/ /usr/bin/make -C src linux.mak
...
chroot("/home/bcs/dmd/") = 0
chdir("/") = 0
execve("/usr/bin/make", ["/usr/bin/make", "-C", "src", "-f", "linux.mak"], [/* 13 vars */]) = -1 ENOENT (No such file or directory)
write(2, "chroot: ", 8chroot: ) = 8
write(2, "cannot run command `/usr/bin/mak"..., 34cannot run command `/usr/bin/make') = 34
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
) = 1
close(1) = 0
close(2) = 0
exit_group(127) = ?
bcs@builder:~/dmd$ ll /home/bcs/dmd/usr/bin/make
-rwxr-xr-x 1 bcs bcs 166112 Sep 17 00:41 /home/bcs/dmd/usr/bin/make*
it seems that the chroot
can't find make
even though it should be there. Any ideas what I'm missing?
BTW: This is on a recent Ubuntu box.