diff options
author | Jim Meyering <jim@meyering.net> | 2000-03-19 17:57:16 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-03-19 17:57:16 +0000 |
commit | 5cb40b672659017a8be818a29e3ad4b1e0993c0e (patch) | |
tree | 95b8152e7ddbe3978642a71babd1ef87e73fdf77 | |
parent | 784f0940b835d07840287cead74096ca1dd8317c (diff) | |
download | coreutils-5cb40b672659017a8be818a29e3ad4b1e0993c0e.tar.xz |
add simple chroot example
-rw-r--r-- | doc/sh-utils.texi | 23 |
1 files changed, 23 insertions, 0 deletions
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 |