[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mandrake-expert
Subject:    Re: [expert] Testing a "standalone" executable for a CD, Help with chroot jail
From:       Randy Kramer <rhkramer () gmail ! com>
Date:       2005-09-29 18:22:14
Message-ID: 200509291422.14787.rhkramer () gmail ! com
[Download RAW message or body]

On Thursday 29 September 2005 12:03 pm, Randy Kramer wrote:
> On Wednesday 28 September 2005 10:31 pm, Pierre Fortin wrote:
> > man chroot mentions 'statically linked' binaries...  this implies some
> > compiler work...  However, as a quick test, I did:
> Thanks!  That helped me get started (more below)--not exactly sure what I
> did wrong the first time I tried--maybe I needed to at least load/install
> /bin and /lib to get any useful feedback (I didn't install them when I
> tried).

OK, I made some decent progress, want to "document" that and mention my 
current roadblocks:

ldd showed that nedit needed about 12 .so libraries.  Started moving them over 
one by one to /testing/lib--usually the library itself and a link (the 
library might have been ...so.6.4, so a link like ...so.6 allowed access 
as ...so.6).

After transferring about 6 libraries, nedit tried to start, looking for its 
~/.nedit file (or directory).  

A few notes at this point: 

Since I want to (1) run from the CD and (2) don't know what user I might be 
(on somebody else's system--they might set up a userid for me or not), I'll 
need to do/consider the following, and (3) want to copy little or nothing to 
their system (partly because I want to keep the code for the stuff I'm 
demoing from "escaping"):

   * Put .nedit on the CD, but when I get to a system, put a link in ~/.nedit 
(for the user I'm logged in as) to the .nedit on the CD.  (At that point I'll 
have to know the mount point for the CD, but that should not be a problem.)

   * Consider making the nedit executable (and the libraries) executable by 
all.

I can deal with those items fairly easily.

My temporary roadblock (and my understanding of it) is this:

Now when I run the following as root: 

[root@system12 testing]# chroot /testing nedit
NEdit: Can't open display

I think this is because I'm logged on to X as a user.  (I.e., there is no X 
display for root to use.)

And if I run the following as a user (myself):

bash-2.05b$ chroot /testing nedit
bash: chroot: command not found

Which I think is because I must be root to run chroot.

So, I can see a few ways forward:

   * Close all my open stuff, log off KDE as myself and log back in as root

   * Take the stuff to another machine (and if necessary) do the same thing

   * Learn how to start a second instance of X and log in as root.

The first two are not practical in the short term (too much stuff open).

If anyone agrees with my assessment and can give me a hint on how to start 
another instance of X/KDE and login as root, I'll proceed from there.

Hmm, maybe it's not as hard as I think--isn't there a Mandrake menu choice to 
do that--ah, yes--Start New Session.

<but that didn't work, here's what happened:>

Let's see what doing that does to my memory usage ;-)  Anyway, I've initiated 
a new session, see some blue background, but have a feeling this will be a 
slow process.

Hmm, this is going terribly slow.  I had disabled 4 of my virtual consoles 
some time ago, so I only have two left, and I'm logged in on both of 
them--maybe that's a problem.

I saw the beginnings of a blue screen of <ctrl><alt>F8, but now all I see is 
black with a flashing - in the upper right hand corner.  Having logged out of 
the two virtual consoles, I'll try again. 

Ok, tried again, same thing as last time--I get the blue screen, I see the box 
where I can choose which user to log in as, it disappears (I guess it's set 
to automatically log in as me), I see the blue screen again, I see the 
outline of another box about the same size as the previous box, it sits there 
for a while, then dies, moving me "back" to my original session (on F7).

</but that didn't work, here's what happened:>

So, I guess I'm still looking for hints, or I'll just look for an opportunity 
to log off the system and login as X

regards,
Randy Kramer


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic