diff options
author | Chris Lumens <clumens@redhat.com> | 2007-09-07 15:27:33 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2007-09-07 15:27:33 +0000 |
commit | 3c502ffaad7883772e7b6d7251edbea0c6d8a69f (patch) | |
tree | 1652efd4a13266e89dac593374ea215c3cd1718e /vnc.py | |
parent | 65212d9e1f27153e722c81a3452971ca233d8cff (diff) | |
download | anaconda-3c502ffaad7883772e7b6d7251edbea0c6d8a69f.tar.gz anaconda-3c502ffaad7883772e7b6d7251edbea0c6d8a69f.tar.xz anaconda-3c502ffaad7883772e7b6d7251edbea0c6d8a69f.zip |
If the vnc server fails to start, log it and quit instead of silently
continuing.
Diffstat (limited to 'vnc.py')
-rw-r--r-- | vnc.py | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -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" |