That gets down to exactly what I was talking about with making sure ALL
necessary files are available inside your chroot jail. Unfortunately, when
libraries are missing, you'll sometimes get the ever popular "file not found"
message when you try to exec the app from within a shell script - even though
the app is definitely there.
When you use chroot, the normal / hierarchy is no longer available, so you
MUST have all the pieces in the chroot hierarchy. Try this:
cp /bin/bash /realbasic/bin/
cd /realbasic/bin
ln -s bash sh
chroot /realbasic
(no application means start a default shell)
You may see a message from bash about not being able to find a library.
You'll need to copy the missing library into your /realbasic/lib directory.
Oh yes, also, make sure that the permissions on the app enable it to be
executable.
Tim
--
Tim Jones tjmac at tolisgroup dot com
Quoting Keith Hutchison <thinker at balance-infosystems dot com>:
> Hi Tim,
>
> On 01/08/2004, at 6:16 AM, tjmac at tolisgroup dot com wrote:
>
> > Hi Keith,
> >
> > Which platform - OS X or Linux?
> >
>
> Linux.
>
> > Under Linux, you could achieve a chroot jail for your app in much the
> > same
> > manner as the LD_LIBRARY_PATH stuff that we were discussing.
> >
> > Create the full jail hierarchy that you require for you app:
> >
> > /opt/MyApp
> > /opt/MyApp/lib
> > /opt/MyApp/etc
> > /opt/MyApp/bin
> > /opt/MyApp/any_other_directories_you_need
> >
> > Then, in your startup script:
> >
> > #!/bin/bash
> > chroot /opt/MyApp MyApp
> >
> > This has the effect of setting /opt/MyApp as the virtual root level
> > for this
> > instance and executing your application.
> >
> > You do need to make sure that all libraries and other bits that your
> > app
> > requires are copied into the /opt/MyApp hierarchy, because if you
> > don't put it
> > there, it won't be there :).
> >
> > Of course, 'man chroot' will offer up much more detail than what I've
> > typed.
> >
>
> Reading, reading reading .:-)
>
> This is what I am currently getting
>
> mail:/realbasic/bin # ./helloworld.bash
> chroot: cannot execute /realbasic/bin/helloworld.mrwb: No such file or
> directory
> mail:/realbasic/bin # ls
> . .. helloworld.bash helloworld.mwrb
>
> The bash file is
> #!/bin/bash
> chroot /realbasic/ /realbasic/bin/helloworld.mrwb
>
> I have tried
> chroot /realbasic/ helloworld.mrwb
> and
> chroot /realbasic/ /bin/helloworld.mrwb
>
> with the same results
>
> Reading, reading reading .:-)
>
> Keith
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives of this list here:
> <http://www.realsoftware.com/listarchives/lists.html>
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|