[Gllug] apt-get failing in chrooted python script...

Bruce Richardson itsbruce at workshy.org
Thu Sep 9 15:59:37 UTC 2010


On Thu, Sep 09, 2010 at 02:35:21PM +0200, Christof Meerwald wrote:
> > OK, that explains the error message.  As I said in my other e-mails, the
> > getcwd() function is returning a broken value.  Now you have to find out
> > why os.chroot isn't setting up the chroot entirely correctly (why the
> > pre-chroot value for the cwd is leaking in).
> 
> see http://www.kernel.org/doc/man-pages/online/pages/man2/chroot.2.html
> 
>   "This call does not change the current working directory, so that
>    after the call '.' can be outside the tree rooted at '/'."
> 
> So you'll probably want to do a os.chdir('/') after the chroot.

That would have been my next suggestion, but was waiting for feedback
from the first tests.

-- 
Bruce

The ice-caps are melting, tra-la-la-la.  All the world is drowning,
tra-la-la-la-la.  -- Tiny Tim.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20100909/70cc2d08/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list