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 chroot jail and adding the > apt key, but when the "apt-get update" command runs, it starts but throws me > an error: > "E: Unable to change to (unreachable)/lxc/test_container/ - chdir (2: No such > file or directory)"
I'm not certain, but this might be due to chrooting without changing directory. Unless os.chroot() does it for you, you'll want to os.chdir("/") immediately afterwards. In any case, it's worth a try. ChrisA -- https://mail.python.org/mailman/listinfo/python-list