On 2/11/07, Stuart Henderson <[EMAIL PROTECTED]> wrote:
>
> On 2007/02/11 00:24, doc Hyde wrote:
> > I have already donne this, here is my output:
> > # ldd /usr/local/bin/rrdtool
>
> That is only part of what I said;
>
> > > It works with the following files copied in (obviously adjust for
> > > machine arch etc). Found by a combination of ldd
> /usr/local/bin/rrdtool,
> > > and 'sudo ktrace -i chroot /var/www /cgi-bin/mailgraph.cgi' - each
> > > time it fails, look at the error messages and/or kdump output,
> > > copy the lib in, and try again.
>
> Notice this bit which I wrote: "each time it fails, look at the error
> messages and/or kdump output, copy the lib in, and try again."
>
> > All copied in my jailed /var/www:
>
> If that's everything, you are missing a whole stack of Perl files.
>
> > # sudo ktrace -i chroot /var/www /cgi-bin/mailgraph/mailgraph.cgi
> > Can't load
> > '/usr/local/libdata/perl5/site_perl/i386-openbsd/auto/RRDs/RRDs.so' for
>
> hmm, I think that one's on the list I made which you appear to have
> ignored...
>
> I'll describe the process in a little bit more detail for anyone who
> wants to learn: mkdir, copy the wanted file in (/usr/loc..../RRDs.so),
> repeat, copy the next in, etc. If it just says 'Unknown error' without
> useful information, run the script chrooted with ktrace, then kdump|more,
> search for the error message, and page back over the next few hundred
> lines and you'll probably see what file it failed to load (probably a
> .so), copy that in, repeat until it works.
>
> (with mailgraph, that's the easy bit - then you get to work out that
> what it's doing when it just sits there apparently doing nothing is it's
> actually tail -f'ing the log ;-)
>
>
I finally got it to work.

I installed syweb for the symon.
There is a script called "install_rrdtool.sh" which installs the necessary
libs for rrdtool to work in a chroot environment.
I launched that script and it most probably copied a library I missed out.
Unfortunately I have no clue which ones where missing.

The ones on your list are not in mine because they aren't on my system at
all.

Here is the script source:
# cat install_rrdtool.sh
#!/bin/sh

# $Id: install_rrdtool.sh,v 1.6 2006/12/20 20:59:14 dijkstra Exp $
#
# Script to install rrdtool inside apache chroot

RRD_CMD=${RRD_CMD:-/usr/local/bin/rrdtool}
PREFIX=${PREFIX:-/var/www}

if [ ! -x ${RRD_CMD} ]; then
    echo cannot find rrdtool - exiting
    exit 0
fi

FORMAT=`file ${RRD_CMD} 2>/dev/null`
if [ "${FORMAT}x" = x ]; then
    echo cannot determine executable format for rrdtool - exiting
    exit 0
fi

ELF=`echo ${FORMAT} | grep ELF`
if [ "${ELF}x" = x ]; then
    LIBS=`ldd "${RRD_CMD}" | sed -e '1d' -e '$d' -e 's/^.* \([^ ]*\)$/\1/g'`
else
    LIBS=`ldd "${RRD_CMD}" | sed -e '1,3d' -e '$d' -e 's/^.* \([^
]*\)$/\1/g'`
fi

if [ "${LIBS}x" = x ]; then
    echo cannot determine library dependencies for ${RRD_CMD} - exiting
    exit 0
fi

cd ${PREFIX}
mkdir -p bin usr/lib usr/libexec
cp -f $LIBS usr/lib
cp -f ${RRD_CMD} bin
cp -f /usr/libexec/ld.so usr/libexec
cp -f /bin/sh bin/sh
echo rrdtool and libs installed in apache root
exit 1


Anyways thanks for your fast answer.

Alban

Reply via email to