Escaping my own chroot...

R

r0g

I'm writing a linux remastering script in python where I need to chroot
into a folder, run some system commands and then come out and do some
tidying up, un-mounting proc & sys etc.

I got in there with os.chroot() and I tried using that to get back out
but that didn't work so... is my script trapped in there forever now or
is there an un-hacky way to escape?

If it is an OS restriction rather than my ignorance of python is there a
canonical way of dealing with it? Should I maybe fork a process, have it
do the chroot and wait for it to terminate before continuing?

Apologies if this turn out to be OT!


Roger.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top