summaryrefslogtreecommitdiffstats
path: root/vnc.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-09-07 15:27:33 +0000
committerChris Lumens <clumens@redhat.com>2007-09-07 15:27:33 +0000
commit3c502ffaad7883772e7b6d7251edbea0c6d8a69f (patch)
tree1652efd4a13266e89dac593374ea215c3cd1718e /vnc.py
parent65212d9e1f27153e722c81a3452971ca233d8cff (diff)
downloadanaconda-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.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/vnc.py b/vnc.py
index 74f3c0f05..9eeee5ff6 100644
--- a/vnc.py
+++ b/vnc.py
@@ -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"