summaryrefslogtreecommitdiffstats
path: root/anaconda
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2009-11-06 15:05:55 -0500
committerPeter Jones <pjones@redhat.com>2009-11-09 13:15:20 -0500
commit78899f07647a5ca7bc40c86434160ed53433e777 (patch)
tree7f1bfb3395afd7baebb87b92b0f8f1052c9cfa2d /anaconda
parent6ef3465dd658dfa6c4981b341caa1e1e13f768df (diff)
downloadanaconda-78899f07647a5ca7bc40c86434160ed53433e777.tar.gz
anaconda-78899f07647a5ca7bc40c86434160ed53433e777.tar.xz
anaconda-78899f07647a5ca7bc40c86434160ed53433e777.zip
Allow remote(ish) debugging.
This changes SIGUSR2 to start a debugger that you can telnet to on port 8080. At the moment you need to do "C-] mode char\n" in your telnet client to get it into character mode instead of line mode.
Diffstat (limited to 'anaconda')
-rwxr-xr-xanaconda10
1 files changed, 10 insertions, 0 deletions
diff --git a/anaconda b/anaconda
index 2f0ca53d6..ed9b6ae67 100755
--- a/anaconda
+++ b/anaconda
@@ -443,6 +443,10 @@ def startSsh():
os.execv("/sbin/sshd", args)
sys.exit(1)
+def startDebugger(signum, frame):
+ import epdb
+ epdb.serve(skip=1)
+
class Anaconda:
def __init__(self):
self.intf = None
@@ -631,6 +635,12 @@ if __name__ == "__main__":
setupEnvironment()
+ pidfile = open("/var/run/anaconda.pid", "w")
+ pidfile.write("%s\n" % (os.getpid(),))
+ del pidfile
+ # add our own additional signal handlers
+ signal.signal(signal.SIGHUP, startDebugger)
+
# we need to do this really early so we make sure its done before rpm
# is imported
iutil.writeRpmPlatform()