nexa / qira

Automatically exported from code.google.com/p/qira
0 stars 0 forks source link

Program fails to delete old runs #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run qira as one user 
2. Kill qira (^C)
3. Run qira again as different user, with no write access to /tmp/qira_logs, 
/tmp/qira_asm

Qira fails with following error:

Traceback (most recent call last):
  File "/usr/local/bin/qira", line 90, in <module>
    program.clear()
  File "/home/vmuser/project/qira/middleware/qira_program.py", line 189, in clear
    self.delete_old_runs()
  File "/home/vmuser/project/qira/middleware/qira_program.py", line 230, in delete_old_runs
    shutil.rmtree(qira_config.TRACE_FILE_BASE)
  File "/usr/lib/python2.7/shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/usr/lib/python2.7/shutil.py", line 250, in rmtree
    os.remove(fullname)
OSError: [Errno 13] Permission denied: '/tmp/qira_logs/0_strace'

The solution is to manually delete /tmp/qira* as owner/root

I know it might not be possible for qira to run the program.clear() on exit 
(BTW: is there a 'safe' way to exit qira?)

But it should be possible to do an try/except and print an "user-friendly" 
error message for this?

Original issue reported on code.google.com by Godo...@gmail.com on 2 Sep 2014 at 12:13