summaryrefslogtreecommitdiffstats
path: root/anaconda
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2008-12-08 11:59:46 -0600
committerDavid Lehman <dlehman@redhat.com>2008-12-08 12:03:19 -0600
commit15d8a4bc5247079bf486939b093ebac15992f83b (patch)
tree8b536fa05334038d56d61d0507d86dfe811e6d9f /anaconda
parent64b793a0136323ea2bb8e1d58628d454cd59724c (diff)
downloadanaconda-15d8a4bc5247079bf486939b093ebac15992f83b.tar.gz
anaconda-15d8a4bc5247079bf486939b093ebac15992f83b.tar.xz
anaconda-15d8a4bc5247079bf486939b093ebac15992f83b.zip
Write anacdump.txt upon receipt of SIGUSR2 (from clumens).
This is the patch Chris posted, modified to use inspect.stack to generate the traceback.
Diffstat (limited to 'anaconda')
-rwxr-xr-xanaconda14
1 files changed, 13 insertions, 1 deletions
diff --git a/anaconda b/anaconda
index ade122dc6..624c19ca1 100755
--- a/anaconda
+++ b/anaconda
@@ -502,6 +502,15 @@ class Anaconda:
# *sigh* we still need to be able to write this out
self.xdriver = None
+ def dumpState(self):
+ from exception import AnacondaExceptionDump
+ 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)
+
def writeXdriver(self, instPath="/"):
# this should go away at some point, but until it does, we
# need to keep it around. it could go into instdata but this
@@ -609,7 +618,7 @@ if __name__ == "__main__":
# this handles setting up updates for pypackages to minimize the set needed
setupPythonUpdates()
- import signal, traceback, string, isys, iutil, time
+ import signal, string, isys, iutil, time
from exception import handleException
import dispatch
import warnings
@@ -632,6 +641,9 @@ 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()
# we need to do this really early so we make sure its done before rpm