XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1
add :$SERVERNUM $XAUTHPROTO $MCOOKIE
EOF
-XAUTHORITY=$AUTHFILE vncserver ":$SERVERNUM" -noxstartup >>"$ERRORFILE" 2>&1 &
+XAUTHORITY=$AUTHFILE vncserver ":$SERVERNUM" >>"$ERRORFILE" 2>&1 &
VNCPID=$!
sleep "$STARTWAIT"
+if ! wait ${VNCPID}; then
+ exit 5
+fi
# Start the command and save its exit status.
set +e
echo "DISPLAY is :${DISPLAY_PORT}"
export PATH=/dn23/NEWGEOM/NEWGEOM_JENKINS_BUILD_AREA/tools:/opt/TurboVNC/bin:${PATH}
-./vnc-run --server-num ${DISPLAY_PORT} vglrun "$@"
+./vnc-run --server-num ${DISPLAY_PORT} -e vnc.err vglrun "$@"