Giter VIP home page Giter VIP logo

selenium-server-deb-package's Introduction

Synopsis

This project is meant to automate debian package for selenium-server It will automatically download selenium-server from google code file repository and package it with init.d scripts.

Building

In order to build the debian package just run

$ ./build.sh pkg [version]

Then it will be found in pkg sub directory

To remove the build package:

$ ./build.sh clean

Running

to run selenium-server daemon just use selenium server init script

selenium-server-deb-package's People

Contributors

floreal avatar xytis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

selenium-server-deb-package's Issues

Stopping selenium-server doesn't work very well

Seems to always fall back to the force_stop block, which is overly complicated and kills too many things.

I changed the selenium server user to "jenkins" so that jenkins user could reap stuck chromedriver/chrome browser processes, but every time I stopped selenium-server, jenkins was dying too.

I did some digging and came up with this patch, which uses pkill and pgrep instead of ps | grep to figure out what's still running and killing the leftovers. This does not touch the running jenkins process.

diff --git a/src/etc/init.d/selenium-server b/src/etc/init.d/selenium-server
index e104b38..f880cc4 100755
--- a/src/etc/init.d/selenium-server
+++ b/src/etc/init.d/selenium-server
@@ -23,6 +23,7 @@ SCRIPTNAME=/etc/init.d/$NAME

 DAEMON=/usr/bin/daemon
 DAEMON_ARGS="--name=$NAME --inherit --env=SELENIUM_HOME=$SELENIUM_HOME --output=$SELENIUM_LOG --pidfile=$PIDFILE"
+PGREP_REGEXP="$SELENIUM_JAR|Xvfb|xvfb-run"

 SU=/bin/su
 # Exit if the package is not installed
@@ -99,14 +100,14 @@ do_start()
 # 
 get_running() 
 {
-    return `ps -U $SELENIUM_USER --no-headers -f | egrep -e '(xvfb-run|Xvfb|java|daemon)' | grep -c . `
+    return `pgrep -c -f "$PGREP_REGEXP"`
 }

 force_stop() 
 {
     get_running
     if [ $? -ne 0 ]; then 
-        killall -u $SELENIUM_USER Xvfb xvfb-run java daemon || return 3
+        pkill -U $SELENIUM_USER -f "$PGREP_REGEXP" || return 3
     fi
 }

@@ -129,6 +130,7 @@ do_stop()
     get_daemon_status 
     case "$?" in
         0) 
+            #THIS DOES NOTHING?!
             $DAEMON $DAEMON_ARGS --stop || return 2
         # wait for the process to really terminate
         for n in 1 2 3 4 5; do

I was not able to figure out why the $DAEMON --stop command was not doing anything, but I bet it has to do with the way the init script is using su -l -u -c $DAEMON... to start which makes the process group worthless.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.