title: how to maintain selenium running on jenkins server
body: <p>I'm having trouble maintaining selenium server running on jenkins slave. I used the following code to run selenium</p>
  
  <pre><code> java -jar /opt/selenium-server-standalone-2.53.0.jar  -Dwebdriver.chrome.args="--use-gl=osmesa" -Dwebdriver.chrome.driver=/usr/bin/chromedriver -Dwebdriver.chrome.bin=/usr/bin/google-chrome  -log /var/log/selenium/selenium.log &gt; /var/log/selenium/output.log 2&gt; /var/log/selenium/error.log &amp; echo $! &gt; /tmp/selenium.pid
  </code></pre>
  
  <p>but I keep getting issues where selenium server dies. Can someone please tell me how best to maintain selenium? What are the best practices that I should know about to maintain selenium server?</p>
  
  <p>I sometimes get the following error when running selenium tests</p>
  
  <pre><code>tests/npw Connection refused! Is selenium server started? 
  
  tests/npw { sessionId: null, 
  status: 13, 
  state: 'unhandled error', 
  
  value: 
  { message: 'Read timed out', 
  suppressed: [], 
  localizedMessage: 'Read timed out', 
  cause: null, 
  class: 'java.net.SocketTimeoutException', 
  hCode: 1232868082, 
  screen: null }, 
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1242507638 } 
  </code></pre>