rootstock cmdline does not respect TMPDIR

Bug #638190 reported by Matt Sealey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RootStock
Confirmed
Low
Unassigned
rootstock (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: rootstock

rootstock (0.1.99.4) cmdline does not respect TMPDIR

discussion with Oliver Grawert revealed that on line 699:

BUILDDIR=$(mktemp -d)

Should be

BUILDDIR=$(mktemp -d -t)

So that mktemp respects the TMPDIR environment variable.

Changed in project-rootstock:
importance: Undecided → Low
milestone: none → 0.1.99.5
status: New → Confirmed
Revision history for this message
Matt Sealey (mwsealey) wrote :

Unfortunately after some testing it seems this simple thing causes a horrible, horrible problem: TMPDIR is passed on to qemu which means when packages are installed, they are fed to a TMPDIR that possibly does not exist on the target system. In my case I have a large disk mounted at /build and errors such as:

debconf: apt-extracttemplates failed: Illegal seek
Extracting templates from packages: 15%E: Could not open file /build/rootstock/tmp/man-db.template.48360 - open (2: No such file or directory)
E: Unable to write to /build/rootstock/tmp/man-db.template.48360 - ofstream::ofstream (2: No such file or directory)
E: Could not open file /build/rootstock/tmp/man-db.config.48361 - open (2: No such file or directory)
E: Unable to write to /build/rootstock/tmp/man-db.config.48361 - ofstream::ofstream (2: No such file or directory)

Inside the "chroot" this directory obviously does not exist.

Possibly the correct solution is to pass -p as well (even though it is deprecated it is the best solution) such as

mktemp -d -p ${ROOTSTOCKTEMP} -t

This way the temporary directory base can be passed as a new rootstock argument (--tmpdir?) without overriding the TMPDIR environment variable and accidentally passing it to the VM. Alternatively, passing TMPDIR=/tmp before qemu-arm-static would make sure it uses the chroot's /tmp directory.

Either solution seems good..

Revision history for this message
Oliver Grawert (ogra) wrote :

we should simply unset TMPDIR before calling the VM

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.