[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: chroot-problem



On Sat, Feb 02, 2002 at 11:27:51PM +0200, Gil Elad wrote:
> [[snip]]
> for some reason I can't get chroot(8) to work. i.e. executing the 
> following command (almost word for word from the info page):
> 
> $ mkdir /tmp/empty
> $ cp /bin/ls /tmp/empty
> $ cd /tmp/empty
> $ chroot /tmp/empty /ls /
> 
> yields:
> 
> chroot: cannot execute /ls: No such file or directory
> 
> What am I doing wrong? is there a kernel config I should know about?
> Any help will be greatly appreciated

Under linux, *very few* executables are stand-alone. I.e. they will
depend on libraries of different kinds. Some libraries may in turn
depend on other libraries.

$ ldd /bin/ls
	librt.so.1 => /lib/librt.so.1 (0x4001d000)
	libc.so.6 => /lib/libc.so.6 (0x4002f000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x40152000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

So for ls(1) to work, you will need the above libraries available in your chroot'ed
environment. Other commands may depend on other libraries.

HTH
-- 
Karl E. Jørgensen
karl@jorgensen.com
www.karl.jorgensen.com
==== Today's fortune:
The first is to ensure your partner understands that nature has root
privileges - nature doesn't have to make sense.
	-- Telsa Gwynne

Attachment: pgpMpZn8ye445.pgp
Description: PGP signature


Reply to: