Open geerlingguy opened 9 years ago
Steps to reproduce:
sudo service selenium status
returns "is running"sudo service selenium stop
(reports "stopping selenium server")sudo service selenium status
returns "is not running"sudo service selenium start
(reports "starting selenium server")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.
I'm seeing the same issue.
Confirming this is still occurring
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
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: https://github.com/arknoll/ansible-role-selenium/pull/23
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,
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
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. Runningservice selenium start
reported success, but selenium didn't start (status
reported it was stopped). Andstop
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.