Skip to content

Commit b6ada51

Browse files
committed
Using new paths and removing logic to export env vars from root to seluser, not needed anymore
1 parent ec6c705 commit b6ada51

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

NodeChromeDebug/entry_point.sh

100644100755
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

33
source /opt/bin/functions.sh
4-
/opt/selenium/generate_config > /opt/selenium/config.json
4+
/opt/bin/generate_config > /home/seluser/selenium/config.json
55

66
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
77

8-
if [ ! -e /opt/selenium/config.json ]; then
8+
if [ ! -e /home/seluser/selenium/config.json ]; then
99
echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2
1010
exit 1
1111
fi
@@ -29,22 +29,16 @@ if [ ! -z "$SE_OPTS" ]; then
2929
echo "appending selenium options: ${SE_OPTS}"
3030
fi
3131

32-
# TODO: Look into http://www.seleniumhq.org/docs/05_selenium_rc.jsp#browser-side-logs
33-
3432
SERVERNUM=$(get_server_num)
3533

3634
rm -f /tmp/.X*lock
3735

38-
env | cut -f 1 -d "=" | sort > asroot
39-
sudo -E -u seluser -i env | cut -f 1 -d "=" | sort > asseluser
40-
sudo -E -i -u seluser \
41-
"$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done)" \
42-
DISPLAY=$DISPLAY \
36+
DISPLAY=$DISPLAY \
4337
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
44-
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
38+
java ${JAVA_OPTS} -jar /home/seluser/selenium/selenium-server-standalone.jar \
4539
-role node \
4640
-hub http://$HUB_PORT_4444_TCP_ADDR:$HUB_PORT_4444_TCP_PORT/grid/register \
47-
-nodeConfig /opt/selenium/config.json \
41+
-nodeConfig /home/seluser/selenium/config.json \
4842
${SE_OPTS} &
4943
NODE_PID=$!
5044

NodeFirefoxDebug/entry_point.sh

100644100755
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

33
source /opt/bin/functions.sh
4-
/opt/selenium/generate_config > /opt/selenium/config.json
4+
/opt/bin/generate_config > /home/seluser/selenium/config.json
55

66
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
77

8-
if [ ! -e /opt/selenium/config.json ]; then
8+
if [ ! -e /home/seluser/selenium/config.json ]; then
99
echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2
1010
exit 1
1111
fi
@@ -29,22 +29,16 @@ if [ ! -z "$SE_OPTS" ]; then
2929
echo "appending selenium options: ${SE_OPTS}"
3030
fi
3131

32-
# TODO: Look into http://www.seleniumhq.org/docs/05_selenium_rc.jsp#browser-side-logs
33-
3432
SERVERNUM=$(get_server_num)
3533

3634
rm -f /tmp/.X*lock
3735

38-
env | cut -f 1 -d "=" | sort > asroot
39-
sudo -E -u seluser -i env | cut -f 1 -d "=" | sort > asseluser
40-
sudo -E -i -u seluser \
41-
"$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done)" \
42-
DISPLAY=$DISPLAY \
36+
DISPLAY=$DISPLAY \
4337
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
44-
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
38+
java ${JAVA_OPTS} -jar /home/seluser/selenium/selenium-server-standalone.jar \
4539
-role node \
4640
-hub http://$HUB_PORT_4444_TCP_ADDR:$HUB_PORT_4444_TCP_PORT/grid/register \
47-
-nodeConfig /opt/selenium/config.json \
41+
-nodeConfig /home/seluser/selenium/config.json \
4842
${SE_OPTS} &
4943
NODE_PID=$!
5044

0 commit comments

Comments
 (0)