Escaping my own chroot...

Discussion in 'Python' started by r0g, Feb 10, 2009.

  1. r0g

    r0g Guest

    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.
     
    r0g, Feb 10, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tosh
    Replies:
    3
    Views:
    1,523
  2. Replies:
    2
    Views:
    555
  3. Replies:
    16
    Views:
    1,505
    Paul Boddie
    Jul 4, 2007
  4. support\.intranet

    Exit from os.chroot()

    support\.intranet, Jun 4, 2008, in forum: Python
    Replies:
    5
    Views:
    616
    Thomas Bellman
    Jun 5, 2008
  5. Jean-Paul Calderone

    Re: Escaping my own chroot...

    Jean-Paul Calderone, Feb 11, 2009, in forum: Python
    Replies:
    0
    Views:
    746
    Jean-Paul Calderone
    Feb 11, 2009
Loading...

Share This Page