LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bash Scripting and Chroot/Exec (https://www.linuxquestions.org/questions/linux-general-1/bash-scripting-and-chroot-exec-392869/)

yoshiznit123 12-14-2005 03:47 PM

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 :-)

jailbait 12-14-2005 03:55 PM

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

yoshiznit123 12-14-2005 04:13 PM

I tried that, but apparently the new bash doesn't recognize that it should continue executing the script. Any ideas?

jailbait 12-14-2005 06:27 PM

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

yoshiznit123 12-14-2005 08:20 PM

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.

yoshiznit123 12-14-2005 08:20 PM

See http://www.linuxquestions.org/questi...d.php?t=248632


All times are GMT -5. The time now is 12:46 AM.