diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | vnc.py | 21 |
2 files changed, 22 insertions, 2 deletions
@@ -6,6 +6,9 @@ * iw/upgrade_bootloader_gui.py: Import logging module (#281031). + * vnc.py (startVNCServer): If the vnc server fails to start, log it + and quit instead of silently continuing. + 2007-09-06 Chris Lumens <clumens@redhat.com> * yuminstall.py (YumBackend.selectModulePackages): Don't always @@ -284,8 +284,25 @@ def startVNCServer(vncpassword="", root='/', vncconnecthost="", # oh well pass - os.execv(args[0], args) - sys.exit (1) + try: + os.execv(args[0], args) + sys.exit (1) + except OSError, e: + stdoutLog.critical("Error running %s: %s" % (root + "/usr/bin/Xvnc", e.strerror)) + sys.exit(1) + + # Wait for a bit, then make sure the VNC server really started before + # stating that it did. + time.sleep(1) + + try: + (pid, status) = os.waitpid(vncpid, os.WNOHANG) + except: + stdoutLog.critical("Could not start the VNC server. Aborting.") + sys.exit(1) + + if os.WIFEXITED(status) and os.WEXITSTATUS(status) > 0: + sys.exit(1) if vncpassword == "": stdoutLog.warning(_("\n\nWARNING!!! VNC server running with NO PASSWORD!\n" |