diff options
author | Michal Toman <mtoman@redhat.com> | 2011-05-02 12:46:36 +0200 |
---|---|---|
committer | Michal Toman <mtoman@redhat.com> | 2011-05-02 12:46:36 +0200 |
commit | 9bf63c4a4036e9b712de372ed1a4cdae08c273ed (patch) | |
tree | c1d93863abb606427541662468a0d9934f67277b | |
parent | 94cb0278e29797645ec1df16ca7274bdfd89ee65 (diff) | |
download | abrt-9bf63c4a4036e9b712de372ed1a4cdae08c273ed.tar.gz abrt-9bf63c4a4036e9b712de372ed1a4cdae08c273ed.tar.xz abrt-9bf63c4a4036e9b712de372ed1a4cdae08c273ed.zip |
retrace server: remove chroot on failure
-rw-r--r-- | src/retrace/retrace.py | 15 | ||||
-rwxr-xr-x | src/retrace/worker.py | 3 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/retrace/retrace.py b/src/retrace/retrace.py index 39588d90..b1568891 100644 --- a/src/retrace/retrace.py +++ b/src/retrace/retrace.py @@ -315,7 +315,7 @@ def kill_process_and_childs(process_id, ps_output=None): return result -def cleanup_task(taskid): +def cleanup_task(taskid, gc=True): null = open("/dev/null", "w") savedir = "%s/%d" % (CONFIG["SaveDir"], taskid) @@ -334,12 +334,13 @@ def cleanup_task(taskid): except: pass - try: - log = open(newlog, "a") - log.write("Killed by garbage collector\n") - log.close() - except: - pass + if gc: + try: + log = open(newlog, "a") + log.write("Killed by garbage collector\n") + log.close() + except: + pass null.close() diff --git a/src/retrace/worker.py b/src/retrace/worker.py index ad2badf1..f3255c2a 100755 --- a/src/retrace/worker.py +++ b/src/retrace/worker.py @@ -27,8 +27,9 @@ def set_status(statusid): def fail(exitcode): "Kills script with given exitcode" - LOG.close() set_status(STATUS_FAIL) + LOG.close() + cleanup_task(int(taskid), False) sys.exit(exitcode) def retrace_run(errorcode, cmd): |