[PATCH 2/2] We have to return tty's control to init's process group at exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Resolves: rhbz#747219
---
 anaconda |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/anaconda b/anaconda
index 945b7e8..170bc3f 100755
--- a/anaconda
+++ b/anaconda
@@ -30,7 +30,7 @@
 
 # This toplevel file is a little messy at the moment...
 
-import sys, os, re, time, subprocess
+import sys, os, re, time, subprocess, atexit
 from optparse import OptionParser
 from tempfile import mkstemp
 
@@ -38,6 +38,9 @@ from tempfile import mkstemp
 wm_pid = None
 xserver_pid = None
 
+def return_tty(fd, pgrp_id):
+    os.tcsetpgrp(fd, pgrp_id)
+
 # Make sure messages sent through python's warnings module get logged.
 def AnacondaShowWarning(message, category, filename, lineno, file=sys.stderr, line=None):
     log.warning("%s" % warnings.formatwarning(message, category, filename, lineno, line))
@@ -605,6 +608,10 @@ class Anaconda(object):
             return []
 
 if __name__ == "__main__":
+    # Register atexit function before anything bad can happen
+    # We have to return tty control back to init's process group
+    atexit.register(return_tty, sys.stdin.fileno(), os.getpgid(os.getppid()))
+
     anaconda = Anaconda()
 
     setupPythonPath()
-- 
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux