adt-run eats its log dir for breakfast

Bug #1463561 reported by Selene ToyKeeper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autopkgtest (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

Before running any tests, adt-run does a 'rm -rf' of its log directory, and aborts if this causes any errors.

This is a problem because it's dangerous, it's unintuitive, and it breaks unix conventions.

Dangerous: Ever tried using $HOME as the log dir? When an attempt to use /tmp for logging fails due to permission issues, the next obvious choice is to use '.' or $HOME, which can cause disaster.

Unintuitive: The obvious first choices for a log dir are places like /tmp, ., $HOME, and /var/log. None of these actually work, and fail with a traceback. It's awkward to require a directory which doesn't even exist.

Breaks conventions: In general, most tools want to have a parent directory or an existing directory specified for their logging, as in the list of common directories above. Then the convention-compliant tool either writes logs to that directory (without first 'rm -rf'ing it) or creates a new child subdirectory such as /tmp/foo.24153/ to store results in. adt-run does not do this, which creates surprising results.

Could we change the log dir behavior of adt-run to be safer and more similar to other tools?

Revision history for this message
Martin Pitt (pitti) wrote :

Indeed, a questionable decision, but so far I didn't have the guts to change it (backwards compatibility, etc.). I'll change it to complain if the log directory already exists and is not empty. That might break a few automated setups, but so be it.

Changed in autopkgtest (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in autopkgtest (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autopkgtest - 3.15.1

---------------
autopkgtest (3.15.1) unstable; urgency=medium

  * adt-buildvm-ubuntu-cloud: Fix lsb_release fallback if python3-distro-info
    is not available.
  * adt-buildvm-ubuntu-cloud: Don't move the uninitialized image to final
    location if QEMU failed.
  * adt-buildvm-ubuntu-cloud: Check availability of genisoimage and access of
    /dev/kvm before downloading image. (LP: #1466486)
  * Get along with dpkg-query not existing, such as in latest Ubuntu Snappy
    images. Skip generation of testbed-packages artifact in that case.
    (LP: #1469647)
  * Adjust NullRunner.test_tmp_install test case to work with pygobject 3.16.

 -- Martin Pitt <email address hidden> Mon, 29 Jun 2015 13:07:34 +0200

Changed in autopkgtest (Ubuntu):
status: Fix Committed → Fix Released
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.