summaryrefslogtreecommitdiffstats
path: root/anaconda
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-11-24 10:53:44 -0500
committerChris Lumens <clumens@redhat.com>2009-11-24 10:53:44 -0500
commit252701734c25cbc7356064f45b809f68b2a4fcdf (patch)
tree4080ab09d7c865564ce615be88b12a368224d4eb /anaconda
parent2fde9d0bf61af2dea407a220074c7e91da1b4f1a (diff)
downloadanaconda-252701734c25cbc7356064f45b809f68b2a4fcdf.tar.gz
anaconda-252701734c25cbc7356064f45b809f68b2a4fcdf.tar.xz
anaconda-252701734c25cbc7356064f45b809f68b2a4fcdf.zip
Fix killall -USR2 anaconda writing out a traceback file.
This hasn't worked since the switch to python-meh, though it's looked like it has worked. Before, dumpState would cause an exception because it hadn't been adapted to python-meh. This exception would then get written out as /tmp/anaconda-tb-*, which made dumpState look like it worked.
Diffstat (limited to 'anaconda')
-rwxr-xr-xanaconda22
1 files changed, 13 insertions, 9 deletions
diff --git a/anaconda b/anaconda
index 785fa7edb..80ef8496b 100755
--- a/anaconda
+++ b/anaconda
@@ -32,6 +32,7 @@
import sys, os, re, time, subprocess
from optparse import OptionParser
+from tempfile import mkstemp
# keep up with process ID of miniwm if we start it
@@ -473,13 +474,18 @@ class Anaconda:
self.xdriver = None
def dumpState(self):
- from exception import AnacondaExceptionDump
+ from meh.dump import ReverseExceptionDump
from inspect import stack as _stack
+
# Skip the frames for dumpState and the signal handler.
stack = _stack()[2:]
stack.reverse()
- exn = AnacondaExceptionDump(None, None, stack)
- exn.write(anaconda)
+ exn = ReverseExceptionDump((None, None, stack), self.mehConfig)
+
+ (fd, filename) = mkstemp("", "anaconda-tb-", "/tmp")
+ fo = os.fdopen(fd, "w")
+
+ exn.write(self, fo)
def writeXdriver(self, instPath="/"):
# this should go away at some point, but until it does, we
@@ -630,9 +636,6 @@ if __name__ == "__main__":
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGSEGV, isys.handleSegv)
- # add our own additional signal handlers
- signal.signal(signal.SIGUSR2, lambda signum, frame: anaconda.dumpState())
-
setupEnvironment()
pidfile = open("/var/run/anaconda.pid", "w")
@@ -965,7 +968,10 @@ if __name__ == "__main__":
# comment out the next line to make exceptions non-fatal
from exception import initExceptionHandling
- initExceptionHandling(anaconda)
+ anaconda.mehConfig = initExceptionHandling(anaconda)
+
+ # add our own additional signal handlers
+ signal.signal(signal.SIGUSR2, lambda signum, frame: anaconda.dumpState())
anaconda.setDispatch()
@@ -981,8 +987,6 @@ if __name__ == "__main__":
fr = None
if fr:
- from tempfile import mkstemp
-
(fw, testcase) = mkstemp(prefix='testcase.py.', dir='/tmp')
os.write(fw, fr.read())
fr.close()