diff options
author | Will Woods <wwoods@redhat.com> | 2009-04-27 14:29:20 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-04-27 15:09:09 -0400 |
commit | fc643049c7283b0a4ff92d73448ac0aba569e712 (patch) | |
tree | fe39066e6d70d9b0cae700c7cd317e078f2eefd0 /anaconda | |
parent | e1930d40ade1dbde463364902880950426f9b9b2 (diff) | |
download | anaconda-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-x | anaconda | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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() |