Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium doesn't always start/stop/restart on Debian #2

Open
geerlingguy opened this issue Sep 9, 2015 · 7 comments
Open

Selenium doesn't always start/stop/restart on Debian #2

geerlingguy opened this issue Sep 9, 2015 · 7 comments

Comments

@geerlingguy
Copy link
Contributor

I had to kill Selenium and start/stop it manually (using java -jar /path/to/selenium) today because the init script seemed to get out of whack on Debian. Running service selenium start reported success, but selenium didn't start (status reported it was stopped). And stop reported it was stopped as well.

I will try to dig into this more in a bit, as I'm currently debugging some Behat tests and can't dig into the selenium problem yet.

@geerlingguy
Copy link
Contributor Author

Steps to reproduce:

  1. Restart VM/computer with selenium installed.
  2. sudo service selenium status returns "is running"
  3. Run sudo service selenium stop (reports "stopping selenium server")
  4. sudo service selenium status returns "is not running"
  5. Run sudo service selenium start (reports "starting selenium server")
  6. sudo service selenium status returns "is not running"

At this point, ps aux | grep java shows that there is an active instance of selenium running, so it seems the pid or something else is not being tracked correctly.

@kostajh
Copy link

kostajh commented Dec 15, 2015

I'm seeing the same issue.

@BrianGilbert
Copy link

Confirming this is still occurring

@AlexSkrypnyk
Copy link
Contributor

The root of the problem is that the created PID is not a PID of the selenium process.

The reason is that service starting command does not start selenium directly, but rather starts xvfb (/usr/bin/xvfb-run), which in its turn starts selenium. The stored PID in /opt/selenium/selenium.pid file is actually a PID of xvfb. Calling selenium service stop stops xvfb, but does not stop selenium.

In the snippet output from ps ax, the PID of selenium is 15285, but selinum.pid file contains the value of 15268.

15268 ?        S      0:00 /bin/sh /usr/bin/xvfb-run /usr/bin/java -client -ja
15282 ?        Sl     0:00 Xvfb :101 -screen 0 640x480x8 -nolisten tcp -auth /
15285 ?        Sl     0:03 /usr/bin/java -client -jar /opt/selenium/selenium-s

Calling service selenium stop does not stop selenium's process:

15282 ?        Sl     0:00 Xvfb :101 -screen 0 640x480x8 -nolisten tcp -auth /
15285 ?        Sl     0:03 /usr/bin/java -client -jar /opt/selenium/selenium-s

arknoll added a commit that referenced this issue Oct 6, 2016
@geerlingguy
Copy link
Contributor Author

If running on Debian 8, there's now a unit file to control restart behavior... this issue might be solved by updating to the latest version of this role. I don't have time to test right now, but the issue should be solved on Debian 8, CentOS 7, and Ubuntu 16.04 the same. See: #23

@ArtuGit
Copy link

ArtuGit commented Aug 20, 2017

I have the same issue in my Debian 8 standalone server.
I can not catch on anything in this topic to solve this issue.

Is it working way to start Selenium using java -jar /path/to/selenium?
It works, but I have another issue with Chrome starting,

@ArtuGit
Copy link

ArtuGit commented Aug 21, 2017

I have this error:

TASK [arknoll.selenium : Register systemd service status (for systemd systems)] **************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "systemctl status selenium | grep \"active (running)\"", "delta": "0:00:00.086507", "end": "2017-08-21 10:47:13.798168", "failed": true, "rc": 1, "start": "2017-08-21 10:47:13.711661", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
...ignoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants