LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
  Search this Thread
Old 12-14-2005, 03:47 PM   #1
yoshiznit123
LQ Newbie
 
Registered: Dec 2005
Posts: 6

Rep: Reputation: 0
Bash Scripting and Chroot/Exec


Hi, I was just writing a shell script that needs to chroot or start another bash shell, but when I tried executing it, the part of the script after the chroot never ran. I was wondering if there was a way to do this without having to make separate scripts. Thanks :-)
 
Old 12-14-2005, 03:55 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by yoshiznit123
Hi, I was just writing a shell script that needs to chroot or start another bash shell, but when I tried executing it, the part of the script after the chroot never ran. I was wondering if there was a way to do this without having to make separate scripts. Thanks :-)

I would guess that after the chroot you would have to make the command paths relative to the new root. If the directories where the commands are located are not accessible from the new root then the commands cannot be executed.

---------------------
Steve Stites
 
Old 12-14-2005, 04:13 PM   #3
yoshiznit123
LQ Newbie
 
Registered: Dec 2005
Posts: 6

Original Poster
Rep: Reputation: 0
I tried that, but apparently the new bash doesn't recognize that it should continue executing the script. Any ideas?
 
Old 12-14-2005, 06:27 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by yoshiznit123
I tried that, but apparently the new bash doesn't recognize that it should continue executing the script. Any ideas?
What error message are you getting?

-------------------
Steve Stites
 
Old 12-14-2005, 08:20 PM   #5
yoshiznit123
LQ Newbie
 
Registered: Dec 2005
Posts: 6

Original Poster
Rep: Reputation: 0
It's not an error, its just that the script I'm trying to run stops after the chroot (sort of like running an exec command); I'm trying to make the script keep running in the new chroot.
 
Old 12-14-2005, 08:20 PM   #6
yoshiznit123
LQ Newbie
 
Registered: Dec 2005
Posts: 6

Original Poster
Rep: Reputation: 0
See http://www.linuxquestions.org/questi...d.php?t=248632
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: chroot: command not found satimis Linux From Scratch 9 03-15-2010 08:38 AM
exec: 431: chroot not found, kernel panic, Attempted to kill init! WalGrom Linux - Software 0 12-11-2005 01:37 PM
exec bash scripts from Glade/GTK? HELP! cho Programming 1 07-04-2005 08:01 AM
Now Bash isnt working within the chroot enviroment matthewa Linux From Scratch 2 06-02-2005 06:37 PM
exec bash command bendeco13 Linux - General 6 10-31-2004 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:30 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration