Skip to content

Commit

Permalink
Merge pull request #31 from arknoll/rebase_more_variables
Browse files Browse the repository at this point in the history
Rebase more variables
  • Loading branch information
arknoll authored Feb 23, 2017
2 parents 1fee738 + 59ea694 commit 53893b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ selenium_install_dir: /opt
selenium_version: "2.53.0"
selenium_install_firefox: no
selenium_install_chrome: yes
selenium_display_id: "1"
selenium_port: 4444
selenium_xvfb_args: "--server-args='-screen 0, 1920x1080x24'"
6 changes: 3 additions & 3 deletions templates/selenium-init-Debian.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

DISPLAY_ID=":1"
DISPLAY_ID="{{ selenium_display_id }}"
RUN_AS=root

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

export DISPLAY="$DISPLAY_ID"

Expand All @@ -37,7 +37,7 @@ case "$1" in
else
log_daemon_msg "Starting Selenium server"
log_progress_msg "selenium"
start-stop-daemon -c $RUN_AS --start --quiet --background --pidfile $DAEMON_PID_FILE --make-pidfile --exec $XVFB_BIN $JAVA_BIN -- $SELENIUM_DAEMON_OPTS
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
fi
;;

Expand Down
9 changes: 4 additions & 5 deletions templates/selenium-init-RedHat.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ xvfb_bin=/usr/bin/xvfb-run
selenium_dir={{ selenium_install_dir }}/selenium
selenium_jar_file="$selenium_dir/selenium-server-standalone-{{ selenium_version }}.jar"
user=root
exec="$xvfb_bin $java_bin"
args=" -client -jar $selenium_jar_file"
display="{{ selenium_display_id }}"
exec="$xvfb_bin {{ selenium_xvfb_args }} --server-num=$display $java_bin"
args=" -client -jar $selenium_jar_file -p {{ selenium_port }}"
lockfile="/var/lock/subsys/selenium"
pidfile="$selenium_dir/selenium.pid"
logfile="$selenium_dir/selenium.log"
prog="selenium"
display=":1"
port="4444"

RETVAL=0

Expand All @@ -35,7 +34,7 @@ start() {
touch $logfile
chown $user $logfile

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

sleep 2

Expand Down

0 comments on commit 53893b0

Please sign in to comment.