LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 05-12-2004, 05:43 AM   #1
dtournas
Member
 
Registered: Aug 2003
Location: Charlotte, North Carolina
Distribution: Red Hat (and look-alike), SUSE (when drunk), Slackware (when mad)
Posts: 148

Rep: Reputation: 15
Cannot 'chroot'


After typing the command:

Code:
chroot /opt/insight /bin/bash -login
I get the output:

Code:
chroot: /bin/bash: No such file or directory
I have made some checks, and the /bin/bash file exists normaly as well as the /opt/insight directory. Don't know why I am doing this, I only go by the book (some manual).

Thanks!
 
Old 05-14-2004, 07:22 AM   #2
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Rep: Reputation: 30
Does /opt/insight/bin/bash exist? AFAIK, chroot looks for the file to execute within the chroot'ed environment.
 
Old 05-14-2004, 07:51 AM   #3
dtournas
Member
 
Registered: Aug 2003
Location: Charlotte, North Carolina
Distribution: Red Hat (and look-alike), SUSE (when drunk), Slackware (when mad)
Posts: 148

Original Poster
Rep: Reputation: 15
Hi, thanks for the reply.

Yes, the /opt/insight/bin/bash exists. I have also tried:

Code:
chroot /opt/insight

But I got the same msg. Should I check sth else?
 
Old 05-14-2004, 05:36 PM   #4
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Rep: Reputation: 30
Maybe /opt/insight/bin/bash is dynamically linked against something outside the chroot. I think that would give the same error message. Try linking bash statically. You could also install a dynamic linker and shared objects in the chrooted environment but thats much harder and more time consuming. If you're planning to run lots of stuff from inside the chroot, though, it could save you lots of memory.

btw, "chroot /opt/insight" is the same as "chroot /opt/insight /bin/sh"
 
Old 05-17-2004, 12:43 AM   #5
dtournas
Member
 
Registered: Aug 2003
Location: Charlotte, North Carolina
Distribution: Red Hat (and look-alike), SUSE (when drunk), Slackware (when mad)
Posts: 148

Original Poster
Rep: Reputation: 15
Thanks for the reply. As time passes by, I make a deeper research about the "chroot" thing... What is all this about, after all? From my pov it is a way to say that temporarily the root directory is going to be the "/opt/insight" right? So what is the meaning of this. Theoretically, I can chdir to /opt/insight and do whatever I need to do.

Is this right or am I just typing...?
 
Old 05-17-2004, 03:34 AM   #6
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Rep: Reputation: 30
Thats pretty much correct. But there is another important point. Once you're inside the chroot'ed environment, you can't see anything outside it. This means you can only run programs that are self-contained withing the /opt/insight directory. Most programs link dynamically against libraries in /lib and /usr/lib. If you want to run any programs from inside the chroot, they must not link against any libraries outside the chroot. You can achieve this either by linking them all statically or by installing a dynamic linker inside /opt/insight and linking the binaries with that linker.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
chroot help Smokey Slackware 8 11-05-2004 06:58 AM
chRoot SpaceCadet Linux - Networking 3 08-14-2003 05:29 AM
Chroot chamkila Linux - General 1 06-13-2003 05:46 AM
Better than chroot? radnix Linux - Security 5 12-20-2002 06:55 PM


All times are GMT -5. The time now is 07:10 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration