From 5cb40b672659017a8be818a29e3ad4b1e0993c0e Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 19 Mar 2000 17:57:16 +0000 Subject: add simple chroot example --- doc/sh-utils.texi | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'doc') diff --git a/doc/sh-utils.texi b/doc/sh-utils.texi index 069a39e1f..41ccf52cc 100644 --- a/doc/sh-utils.texi +++ b/doc/sh-utils.texi @@ -2783,6 +2783,29 @@ variable or @code{/bin/sh} if not set, invoked with the @samp{-i} option. The only options are @samp{--help} and @samp{--version}. @xref{Common options}. +Here are a few tips to help avoid common problems in using chroot. +To start with a simple example, make @var{command} refer to a statically +linked binary. If you were to use a dynamically linked executable, then +you'd have to arrange to have the shared libraries in the right place under +your new root directory. + +For example, if you create a statically linked `ls' executable, +and put it in /tmp/empty, you can run this command as root: + +@example +$ chroot /tmp/empty /ls -Rl / +@end example + +Then you'll see output like this: + +@example +/: +total 1023 +-rwxr-xr-x 1 0 0 1041745 Aug 16 11:17 ls +@end example + +@c FIXME: add a more complex example + @node env invocation @section @code{env}: Run a command in a modified environment -- cgit v1.2.3-54-g00ecf