running a chroot'ed webserver



Dear List,

I'm setting up a chroot to run my webserver in; I need only a few simple
programs from /bin and /usr/bin (cat, head, date, nc, etc..);

I used to have a script that would analyze the output of "ldd <prog>"
and produce a list of all the libs needed to run the said programs;

after I upgraded from Debian.sarge to Debian.etch it stopped working; I
can see that both the output of ldd and the structure of /lib has
changed substantially!!!

so I guess I need to understand how to read the output of ldd!
please see if you can help me:

$ uname -a
Linux kellogs 2.6.18-6-686 #1 SMP Sun Feb 10 22:11:31 UTC 2008 i686 GNU/Linux

$ ldd --version
ldd (GNU libc) 2.3.6
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

$ ldd /bin/cat
linux-gate.so.1 => (0xffffe000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7eb0000)
/lib/ld-linux.so.2 (0xb7fe8000)

how do I read the output of ldd?

line #1 points to an empty name; why?
"locate linux-gate" returns nothing!!!

why such a deep dir structure in line #2?
I was *really* scared when I did:
$ find /lib -name libc.so.6 -exec ls -Ll {} \;
-rwxr-xr-x 1 root root 1147548 Jan 19 10:14 /lib/libc.so.6
-rw-r--r-- 1 root root 1241392 Jan 19 10:15 /lib/tls/i686/cmov/libc.so.6
-rw-r--r-- 1 root root 1245488 Jan 19 10:14 /lib/tls/libc.so.6
$
wow!!! 3 different versions of libc.so.6!!!
(I hope there was a *strong* reason for that)

line #3 has no pointer (=>)! why?

to put it simple: I need to know the list of libs from /lib and /usr/lib
that I have to mirror in /opt/www/lib and /opt/www/usr/lib in order to
/opt/www/bin/cat to run inside the chroot;

[]s and TIA,

PS: this post would fit better in linux.debian.usr but my messages to it
are being silently dropped! and I used to post to linux.debian.user
w/o problems! is linux.debian.user being moderated now?

--
Otavio Exel /<\oo/>\ oexel@xxxxxxxxxxxxxxxxxx
.



Relevant Pages

  • Re: SFTP only
    ... You can chroot SSH by applying a patch to the OpenSSH source and the rebuilding. ... You still have to run ldd to identify the needed files and copy those to the chrooted environment. ... SFTP, but again they can still navigate the filesystem. ...
    (SSH)
  • newbie chroot problem - restated
    ... Using CentOS 4.1 as root with bash as my shell, ... # ldd /bin/bash ... So I then created the following directory setup: ... when I try chroot /crtest I get: ...
    (comp.os.linux.misc)
  • newbie chroot problem - restated
    ... Using CentOS 4.1 as root with bash as my shell, ... # ldd /bin/bash ... So I then created the following directory setup: ... when I try chroot /crtest I get: ...
    (comp.os.linux)
  • newbie chroot problem - restated
    ... Using CentOS 4.1 as root with bash as my shell, ... # ldd /bin/bash ... So I then created the following directory setup: ... when I try chroot /crtest I get: ...
    (alt.os.linux)
  • newbie chroot problem - restated
    ... Using CentOS 4.1 as root with bash as my shell, ... # ldd /bin/bash ... So I then created the following directory setup: ... when I try chroot /crtest I get: ...
    (alt.os.linux.redhat)