adt-run eats its log dir for breakfast
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-
Could we change the log dir behavior of adt-run to be safer and more similar to other tools?
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.