Exit from Dir.chroot()

Discussion in 'Ruby' started by hgarg.india, Mar 29, 2014.

  1. hgarg.india

    hgarg.india Guest

    Hello,

    How can I exit from Dir.chroot("/rootfs") ?

    Thanks.
     
    hgarg.india, Mar 29, 2014
    #1
    1. Advertisements

  2. Exit the process.

    Cheers

    robert
     
    Robert Klemme, Mar 29, 2014
    #2
    1. Advertisements

  3. hgarg.india

    hgarg.india Guest

    Any other clear strategy, as I am using ruby in CHEF so, calling Process.exit exits the chef also.
     
    hgarg.india, Mar 29, 2014
    #3
  4. hgarg.india

    hgarg.india Guest

    I want to exit chroot while still running the script.
     
    hgarg.india, Mar 29, 2014
    #4
  5. Strategy should be obvious: fork, then in child: chroot, do work, exit.

    Cheers

    robert
     
    Robert Klemme, Mar 29, 2014
    #5
  6. hgarg.india

    hgarg.india Guest

     
    hgarg.india, Mar 30, 2014
    #6
  7. hgarg.india

    Seebs Guest

    The entire point of chroot is to prevent you from exiting it...

    -s
     
    Seebs, Apr 8, 2014
    #7
  8. hgarg.india

    Kaz Kylheku Guest

    No it isn't the entire point. That's just the security aspect of chroot.

    There is also a utility aspect of chroot, which is to create a modified
    environment in which absolute paths change semantics in order to simplify
    something: for instance, allowing programs to be compiled using different
    tools, and against different header files and libraries, while still using
    paths like /usr/include or /usr/bin.

    Having to be subject to the security aspect when you only need the pragmatic
    aspect is an annoying limitation of chroot.
     
    Kaz Kylheku, Apr 8, 2014
    #8
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.