Skip to content

Commit 53893b0

Browse files
authored
Merge pull request #31 from arknoll/rebase_more_variables
Rebase more variables
2 parents 1fee738 + 59ea694 commit 53893b0

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

defaults/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ selenium_install_dir: /opt
44
selenium_version: "2.53.0"
55
selenium_install_firefox: no
66
selenium_install_chrome: yes
7+
selenium_display_id: "1"
8+
selenium_port: 4444
9+
selenium_xvfb_args: "--server-args='-screen 0, 1920x1080x24'"

templates/selenium-init-Debian.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
1313

14-
DISPLAY_ID=":1"
14+
DISPLAY_ID="{{ selenium_display_id }}"
1515
RUN_AS=root
1616

1717
JAVA_BIN=/usr/bin/java
@@ -22,7 +22,7 @@ SELENIUM_DIR={{ selenium_install_dir }}/selenium
2222
SELENIUM_JAR_FILE="$SELENIUM_DIR/selenium-server-standalone-{{ selenium_version }}.jar"
2323
DAEMON_PID_FILE="$SELENIUM_DIR/selenium.pid"
2424
SELENIUM_LOG_FILE="$SELENIUM_DIR/selenium.log"
25-
SELENIUM_DAEMON_OPTS=" -client -jar $SELENIUM_JAR_FILE -log $SELENIUM_LOG_FILE"
25+
SELENIUM_DAEMON_OPTS=" -client -jar $SELENIUM_JAR_FILE -log $SELENIUM_LOG_FILE -port {{ selenium_port }}"
2626

2727
export DISPLAY="$DISPLAY_ID"
2828

@@ -37,7 +37,7 @@ case "$1" in
3737
else
3838
log_daemon_msg "Starting Selenium server"
3939
log_progress_msg "selenium"
40-
start-stop-daemon -c $RUN_AS --start --quiet --background --pidfile $DAEMON_PID_FILE --make-pidfile --exec $XVFB_BIN $JAVA_BIN -- $SELENIUM_DAEMON_OPTS
40+
start-stop-daemon -c $RUN_AS --start --quiet --background --pidfile $DAEMON_PID_FILE --make-pidfile --exec $XVFB_BIN {{ selenium_xvfb_args }} $JAVA_BIN -- $SELENIUM_DAEMON_OPTS
4141
fi
4242
;;
4343

templates/selenium-init-RedHat.j2

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ xvfb_bin=/usr/bin/xvfb-run
1515
selenium_dir={{ selenium_install_dir }}/selenium
1616
selenium_jar_file="$selenium_dir/selenium-server-standalone-{{ selenium_version }}.jar"
1717
user=root
18-
exec="$xvfb_bin $java_bin"
19-
args=" -client -jar $selenium_jar_file"
18+
display="{{ selenium_display_id }}"
19+
exec="$xvfb_bin {{ selenium_xvfb_args }} --server-num=$display $java_bin"
20+
args=" -client -jar $selenium_jar_file -p {{ selenium_port }}"
2021
lockfile="/var/lock/subsys/selenium"
2122
pidfile="$selenium_dir/selenium.pid"
2223
logfile="$selenium_dir/selenium.log"
2324
prog="selenium"
24-
display=":1"
25-
port="4444"
2625

2726
RETVAL=0
2827

@@ -35,7 +34,7 @@ start() {
3534
touch $logfile
3635
chown $user $logfile
3736

38-
/bin/su - $user -c "DISPLAY=\"$display\" $exec $args >> $logfile 2>&1 & echo \$! > $pidfile"
37+
/bin/su - $user -c "DISPLAY=\":$display\" $exec $args >> $logfile 2>&1 & echo \$! > $pidfile"
3938

4039
sleep 2
4140

0 commit comments

Comments
 (0)