We use Jenkins to test the php code of our website. For this, we have a selenium webdriver running under the Jenkins user. Previously, the Jenkins service started up correctly while the selenium service was running.
Yesterday, the jenkins service would not start after the reboot of the server.
A little digging showed the problem was the function get_running in /etc/init.d/jenkins, which tests quite greedily if there are any java programs running under the `jenkins` user. When there are, the service is not started, but exits with code 7.
We hotfixed it by making selenium dependent on jenkins (such that selenium will only start when jenkins is running). But then still a simple restart of jenkins is not possible when selenium has started, and anyone who tries this and does not know that our selenium is the problem will be confused.
Could the get_running function be a bit less greedy?
(currently it is doing ps -U $JENKINS_USER --no-headers -f | egrep -e '(java)' | grep -v defunct | grep -c .. An extra grep for e.g. daemon would be better I guess? Or even a grep for daemon and a grep for name=$NAME or something?)