[master/f20/rhel7] Ignore SIGINT (#971323)

mulhern amulhern at redhat.com
Fri Oct 25 17:16:01 UTC 2013


Resolves: rhbz#971323

Ignore SIGINT instead of doing the default action. Also, remove the
KeyboardInterrupt handling in the pyanaconda thread manager since these
threads should never see a Keyboard Interrupt.

There is a justification for this:
1) There's some way of exiting all set up screens, and
2) Interrupting the actual install is a bad idea, and
3) If you know what you're doing you can send it a kill signal which it will
still obey.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 anaconda              | 2 +-
 pyanaconda/threads.py | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/anaconda b/anaconda
index b00c78c..ce37365 100755
--- a/anaconda
+++ b/anaconda
@@ -763,7 +763,7 @@ if __name__ == "__main__":
     iutil.setup_translations(gettext)
 
     # reset python's default SIGINT handler
-    signal.signal(signal.SIGINT, signal.SIG_DFL)
+    signal.signal(signal.SIGINT, signal.SIG_IGN)
     signal.signal(signal.SIGSEGV, isys.handleSegv)
     signal.signal(signal.SIGTERM, lambda num, frame: sys.exit(1))
 
diff --git a/pyanaconda/threads.py b/pyanaconda/threads.py
index 1f1d9c6..b861cea 100644
--- a/pyanaconda/threads.py
+++ b/pyanaconda/threads.py
@@ -166,8 +166,6 @@ class AnacondaThread(threading.Thread):
         log.info("Running Thread: %s (%s)" % (self.name, self.ident))
         try:
             threading.Thread.run(self, *args, **kwargs)
-        except KeyboardInterrupt:
-            raise
         except:
             threadMgr.set_error(self.name, *sys.exc_info())
             sys.excepthook(*sys.exc_info())
-- 
1.8.3.1



More information about the anaconda-patches mailing list