[PATCH 2/2] Switch to tty1 if we get an exception before meh is setup

David Shea dshea at redhat.com
Wed Jun 25 18:17:34 UTC 2014


Being left with a blank screen on failures isn't particularly helpful
---
 anaconda | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/anaconda b/anaconda
index 2a9469c..8d6318c 100755
--- a/anaconda
+++ b/anaconda
@@ -1014,6 +1014,19 @@ if __name__ == "__main__":
     flags.selinux = opts.selinux
     flags.eject = opts.eject
 
+    # Switch to tty1 on exception in case something goes wrong during X start.
+    # This way if, for example, metacity doesn't start, we switch back to a
+    # text console with a traceback instead of being left looking at a blank
+    # screen. python-meh will replace this excepthook with its own handler
+    # once it gets going.
+    if not flags.imageInstall and not flags.livecdInstall \
+       and not flags.dirInstall:
+        def _earlyExceptionHandler(ty, value, traceback):
+            iutil.vtActivate(1)
+            return sys.__excepthook__(ty, value, traceback)
+
+        sys.excepthook = _earlyExceptionHandler
+
     if can_touch_runtime_system("start audit daemon"):
         startAuditDaemon()
 
-- 
2.0.0



More information about the anaconda-patches mailing list