作爲一個替代我真正的問題:有誰知道一個簡單的命令行工具,使chroot監獄?我正在考慮一些將運行命令並將所需的所有內容複製到給定目錄中的東西。我看到了一個工具的方向,但它有配置文件,似乎期待着我從X啓動它,這兩種工具都不適合我的情況。爲什麼不能chroot工作?
而對於真正的問題:
我試圖建立一個chroot監獄,它不工作。這是我所得到的,當我與strace命令:
[email protected]:~/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) = ?
[email protected]:~/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*
似乎chroot
找不到make
即使它應該在那裏。任何想法我失蹤?
BTW:這是在最近的Ubuntu盒子上。
我已經添加了linux標籤,因爲您似乎試圖用linux makefile(linux.mak)來構建它。請修復此錯誤,並添加適當的操作系統標籤。 – camh 2010-09-17 01:00:55
@camh:賓果... – BCS 2010-09-17 01:02:19