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

Re: start-stop-daemon with chroot ?



Hello supermega,

do you also have a real name?

On 2008-07-11 03:59 +0200, supermega wrote:

> I'd like to use start-stop-daemon with chroot option, but I get a
> strange error. A test:
> # start-stop-daemon --start --chroot /bin --exec ls
> start-stop-daemon: Unable to start ls: No such file or directory (No
> such file or directory)
>
> I should work, shouldn't it?

No, this cannot work.  At least not if /bin/ls is the standard file from
the coreutils package.

> When I run this:
> # start-stop-daemon --start --chroot /bin --exec inexistant_file
> The error is different:
> start-stop-daemon: stat /bin/inexistant_file: No such file or
> directory (No such file or directory)
>
> Why the first command doesn't work?

Because /bin/ls is dynamically linked, but no linker or shared libraries
exist in the chroot.  The error you see is described in execve(2):

	ENOENT
		The file filename or a  script or ELF interpreter does not exist,
		or  a shared  library needed  for file  or interpreter  cannot be
		found.

Running a statically linked program should work (can't try right now
because I don't have one installed).

Sven


Reply to: