Hi,

Quoting Francesco Poli (2020-01-30 23:41:11)
> On Thu, 30 Jan 2020 01:26:09 +0100 Johannes Schauer wrote:
> > the problem is fixed when TMPDIR gets unset for hook.
> Wait, does this change the result?
> 
> I mean: some commands executed (directly or indirectly) by
> setup-testbed perform operations on the directory which mmdebstrap set
> up as TMPDIR.
> If this is the case (as I think it is, at least for the udev hook
> called by update-initramfs), I wonder whether unsetting TMPDIR causes
> setup-testbed to perform some of its operations on the wrong directory...
> 
> Am I completely off-track?

in your case, TMPDIR was a relative path. It doesn't even matter whether the
script reading TMPDIR runs inside or outside the chroot. That script might
change its working directory to anywhere during its operation. If it then tries
to access a file that expects to be in $TMPDIR it will obviously not find it
because it changed working directory.

Another scenario: imagine you set TMPDIR to an absolute path outside the
chroot. Naturally, that path is not available inside the chroot and programs
inside the chroot might fail when they try to store data into the non-existing
TMPDIR.

Your expectation was, that when you set TMPDIR, the only one who would consume
that environment variable would be mmdebstrap itself. I think that thought is
not unreasonable. That's why I think it's important that mmdebstrap unsets that
variable before it executes processes inside the chroot.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to