Re: chroot to install packages

2013-11-14 Thread Himanshu Garg
I have done it but having a problem. I have written a script os.chroot(/lxc/test_container/rootfs) subprocess.call([apt-key, add, /root/package.key]) subprocess.call([apt-get, update]) os._exit(0) Now, this script is working properly, entering the chroot jail and adding the apt key, but when

Re: chroot to install packages

2013-11-14 Thread Chris Angelico
On Thu, Nov 14, 2013 at 8:29 PM, Himanshu Garg hgarg.in...@gmail.com wrote: I have written a script os.chroot(/lxc/test_container/rootfs) subprocess.call([apt-key, add, /root/package.key]) subprocess.call([apt-get, update]) os._exit(0) Now, this script is working properly, entering the

Re: chroot to install packages

2013-11-14 Thread Himanshu Garg
os.chdir(/) immediately afterwards. In any case, it's worth a try. ChrisA Very thanks. the trick worked. -- https://mail.python.org/mailman/listinfo/python-list

chroot to install packages

2013-11-13 Thread Himanshu Garg
I am writing a python script to run chroot command to chroot to a linux distro and then run commands. How can I do this, as after chrooting, the script runs the commands relative to the outside not inside the chrooted env? -- https://mail.python.org/mailman/listinfo/python-list

Re: chroot to install packages

2013-11-13 Thread Chris Angelico
On Thu, Nov 14, 2013 at 1:31 AM, Himanshu Garg hgarg.in...@gmail.com wrote: I am writing a python script to run chroot command to chroot to a linux distro and then run commands. How can I do this, as after chrooting, the script runs the commands relative to the outside not inside the

Re: chroot to install packages

2013-11-13 Thread Himanshu Garg
On Thursday, November 14, 2013 5:10:20 AM UTC+5:30, Chris Angelico wrote: On Thu, Nov 14, 2013 at 1:31 AM, Himanshu Garg hgarg.in...@gmail.com wrote: I am writing a python script to run chroot command to chroot to a linux distro and then run commands. How can I do this, as after

Re: chroot to install packages

2013-11-13 Thread Chris Angelico
On Thu, Nov 14, 2013 at 12:52 PM, Himanshu Garg hgarg.in...@gmail.com wrote: How can I do that? Can you guide me? First off: Google Groups is making your posts very ugly. Please either fix them before posting, or use a better client. https://wiki.python.org/moin/GoogleGroupsPython As to

Re: chroot to install packages

2013-11-13 Thread Steven D'Aprano
On Wed, 13 Nov 2013 17:52:42 -0800, Himanshu Garg wrote: On Thursday, November 14, 2013 5:10:20 AM UTC+5:30, Chris Angelico wrote: On Thu, Nov 14, 2013 at 1:31 AM, Himanshu Garg hgarg.in...@gmail.com wrote: I am writing a python script to run chroot command to chroot to a linux distro

Re: chroot to install packages

2013-11-13 Thread Chris Angelico
On Thu, Nov 14, 2013 at 1:12 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The next bit is the part I have no idea about... use your operating system tools to set up a chroot jail for inside.py. Google is your friend there, I'm sure there will be many, many websites that