File tree Expand file tree Collapse file tree 4 files changed +29
-25
lines changed Expand file tree Collapse file tree 4 files changed +29
-25
lines changed Original file line number Diff line number Diff line change @@ -53,4 +53,4 @@ xvfb-run -a --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
5353NODE_PID=$!
5454
5555trap shutdown SIGTERM SIGINT
56- wait $NODE_PID
56+ wait ${ NODE_PID}
Original file line number Diff line number Diff line change 5252
5353rm -f /tmp/.X* lock
5454
55- xvfb-run -a --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR" \
55+ # Creating a file descriptor, where the DISPLAY will be saved ("6" was arbitrarily chosen)
56+ exec 6> /tmp/display.log
57+ xvfb-run -a --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR -displayfd 6" \
5658 java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
5759 -role node \
58- -hub http://$HUB_PORT_4444_TCP_ADDR : $ HUB_PORT_4444_TCP_PORT /grid/register \
60+ -hub http://${ HUB_PORT_4444_TCP_ADDR} : ${ HUB_PORT_4444_TCP_PORT} /grid/register \
5961 ${REMOTE_HOST_PARAM} \
6062 -nodeConfig /opt/selenium/config.json \
6163 ${SE_OPTS} &
6264NODE_PID=$!
65+ exec 6>& -
6366
6467trap shutdown SIGTERM SIGINT
6568for i in $( seq 1 10)
6669do
67- DISPLAY= $( xvfb-run printenv DISPLAY )
68- if [ -z " $ DISPLAY" ] ; then
69- echo " \$ DISPLAY env variable is empty "
70- break
70+ sleep 1
71+ export DISPLAY=: $( cat /tmp/display.log )
72+ if [ " ${ DISPLAY} " != " : " ] ; then
73+ echo " Display ${DISPLAY} allocated "
7174 fi
72- xdpyinfo -display $DISPLAY > /dev/null 2>&1
75+ xdpyinfo -display ${ DISPLAY} > /dev/null 2>&1
7376 if [ $? -eq 0 ]; then
7477 break
7578 fi
76- echo Waiting xvfb...
77- sleep 0.5
79+ echo " Waiting xvfb..."
7880done
7981
80- fluxbox -display $DISPLAY &
82+ fluxbox -display ${ DISPLAY} &
8183
82- x11vnc $X11VNC_OPTS -forever -shared -rfbport 5900 -display $DISPLAY &
84+ x11vnc ${ X11VNC_OPTS} -forever -shared -rfbport 5900 -display ${ DISPLAY} &
8385
84- wait $NODE_PID
86+ wait ${ NODE_PID}
Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ xvfb-run -a --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
2121NODE_PID=$!
2222
2323trap shutdown SIGTERM SIGINT
24- wait $NODE_PID
24+ wait ${ NODE_PID}
Original file line number Diff line number Diff line change 2222
2323rm -f /tmp/.X* lock
2424
25- xvfb-run -a --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR" \
25+ # Creating a file descriptor, where the DISPLAY will be saved ("6" was arbitrarily chosen)
26+ exec 6> /tmp/display.log
27+ xvfb-run -a --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR -displayfd 6" \
2628 java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
2729 ${SE_OPTS} &
2830NODE_PID=$!
31+ exec 6>& -
2932
3033trap shutdown SIGTERM SIGINT
3134for i in $( seq 1 10)
3235do
33- DISPLAY= $( xvfb-run printenv DISPLAY )
34- if [ -z " $ DISPLAY" ] ; then
35- echo " \$ DISPLAY env variable is empty "
36- break
36+ sleep 1
37+ export DISPLAY=: $( cat /tmp/display.log )
38+ if [ " ${ DISPLAY} " != " : " ] ; then
39+ echo " Display ${DISPLAY} allocated "
3740 fi
38- xdpyinfo -display $DISPLAY > /dev/null 2>&1
41+ xdpyinfo -display ${ DISPLAY} > /dev/null 2>&1
3942 if [ $? -eq 0 ]; then
4043 break
4144 fi
42- echo Waiting xvfb...
43- sleep 0.5
45+ echo " Waiting xvfb..."
4446done
4547
46- fluxbox -display $DISPLAY &
48+ fluxbox -display ${ DISPLAY} &
4749
48- x11vnc $X11VNC_OPTS -forever -shared -rfbport 5900 -display $DISPLAY &
50+ x11vnc ${ X11VNC_OPTS} -forever -shared -rfbport 5900 -display ${ DISPLAY} &
4951
50- wait $NODE_PID
52+ wait ${ NODE_PID}
You can’t perform that action at this time.
0 commit comments