summaryrefslogtreecommitdiffstats
path: root/anaconda
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2009-04-27 14:29:20 -0400
committerChris Lumens <clumens@redhat.com>2009-04-27 15:09:09 -0400
commitfc643049c7283b0a4ff92d73448ac0aba569e712 (patch)
treefe39066e6d70d9b0cae700c7cd317e078f2eefd0 /anaconda
parente1930d40ade1dbde463364902880950426f9b9b2 (diff)
downloadanaconda-fc643049c7283b0a4ff92d73448ac0aba569e712.tar.gz
anaconda-fc643049c7283b0a4ff92d73448ac0aba569e712.tar.xz
anaconda-fc643049c7283b0a4ff92d73448ac0aba569e712.zip
Properly restore SIGCHLD if X startup fails
Before starting X we set up a SIGCHLD handler to raise OSError if Xorg dies. But if that happens, we'll skip over the code that restores the old SIGCHLD handler, and thus the next subprocess we run will cause anaconda to catch OSError and die. This patch moves the signal restore code into a finally: block.
Diffstat (limited to 'anaconda')
-rwxr-xr-xanaconda8
1 files changed, 4 insertions, 4 deletions
diff --git a/anaconda b/anaconda
index bc5ed4556..5e8d6ce1d 100755
--- a/anaconda
+++ b/anaconda
@@ -833,9 +833,9 @@ if __name__ == "__main__":
def preexec_fn():
signal.signal(signal.SIGUSR1, signal.SIG_IGN)
- xout = open("/dev/tty5", "w")
old_sigusr1 = signal.signal(signal.SIGUSR1, sigusr1_handler)
old_sigchld = signal.signal(signal.SIGCHLD, sigchld_handler)
+ xout = open("/dev/tty5", "w")
proc = subprocess.Popen(["Xorg", "-br", "-logfile", "/tmp/X.log",
":1", "vt6", "-s", "1440", "-ac",
@@ -845,9 +845,6 @@ if __name__ == "__main__":
signal.pause()
- signal.signal(signal.SIGUSR1, old_sigusr1)
- signal.signal(signal.SIGCHLD, old_sigchld)
-
os.environ["DISPLAY"] = ":1"
doStartupX11Actions(opts.runres)
xserver_pid = proc.pid
@@ -856,6 +853,9 @@ if __name__ == "__main__":
opts.display_mode = 't'
graphical_failed = 1
time.sleep(2)
+ finally:
+ signal.signal(signal.SIGUSR1, old_sigusr1)
+ signal.signal(signal.SIGCHLD, old_sigchld)
if opts.display_mode == 't' and graphical_failed and not anaconda.isKickstart:
ret = vnc.askVncWindow()