title: Restarting Jetty on Ubuntu 12.04.4
body: <p>I'm getting some very unusual behaviour.</p>
  
  <p>I followed <a href="http://pietervogelaar.nl/ubuntu-12-04-install-jetty-9/" rel="nofollow">these instructions for installing jetty</a> but used the latest version instead (9.1.1v20140108)</p>
  
  <p>I had reason to restart Jetty and found I was getting these errors (logged in as root)</p>
  
  <p>Starting Jetty: FAILED Wed Feb  5 12:35:59 EST 2014</p>
  
  <p>So I spent 30 mins looking for an answer, then for reasons I can't recall, I did service jetty check and it was running (had a pid).</p>
  
  <p>So I tried again with service Jetty stop:</p>
  
  <pre><code>root@erp:/var/log# service jetty stop
  /etc/init.d/jetty: line 13: chkconfig:: command not found
  /etc/init.d/jetty: line 14: description:: command not found
  /etc/init.d/jetty: line 15: processname:: command not found
  Stopping Jetty: start-stop-daemon: warning: failed to kill 7817: No such process
  1 pids were not killed
  No process in pidfile '/var/run/jetty.pid' found running; none killed.
  OK
  </code></pre>
  
  <p>None killed? Ok. Let's check that:</p>
  
  <pre><code>root@erp:/var/log# service jetty check
  /etc/init.d/jetty: line 13: chkconfig:: command not found
  /etc/init.d/jetty: line 14: description:: command not found
  /etc/init.d/jetty: line 15: processname:: command not found
  Checking arguments to Jetty:
  START_INI      =  /srv/jetty/start.ini
  JETTY_HOME     =  /srv/jetty
  JETTY_BASE     =  /srv/jetty
  JETTY_CONF     =  /srv/jetty/etc/jetty.conf
  JETTY_PID      =  /var/run/jetty.pid
  JETTY_START    =  /srv/jetty/start.jar
  JETTY_LOGS     =  /srv/jetty/logs
  CLASSPATH      =
  JAVA           =  /usr/bin/java
  JAVA_OPTIONS   =  -Dsolr.solr.home=/srv/solr  -Djetty.state=/srv/jetty/jetty.state -Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty -Djava.io.tmpdir=/tmp
  JETTY_ARGS     =  jetty.port=8085 jetty-logging.xml jetty-started.xml
  RUN_CMD        =  /usr/bin/java -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state -Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty -Djava.io.tmpdir=/tmp -jar /srv/jetty/start.jar jetty.port=8085 jetty-logging.xml jetty-started.xml
  </code></pre>
  
  <p>No PID? Let's check that:</p>
  
  <pre><code>root@erp:/var/log# service jetty start
  /etc/init.d/jetty: line 13: chkconfig:: command not found
  /etc/init.d/jetty: line 14: description:: command not found
  /etc/init.d/jetty: line 15: processname:: command not found
  Starting Jetty: FAILED Wed Feb  5 12:39:43 EST 2014
  </code></pre>
  
  <p>Ok, is there a PID?</p>
  
  <pre><code>root@erp:/var/log# service jetty check
  /etc/init.d/jetty: line 13: chkconfig:: command not found
  /etc/init.d/jetty: line 14: description:: command not found
  /etc/init.d/jetty: line 15: processname:: command not found
  Checking arguments to Jetty: 
  [edit]
  
  Jetty running pid=7993
  </code></pre>
  
  <p>Weird. Sure enough, a stop and check will give the same results.</p>
  
  <p>What's going on with the jetty startup script? And why am I getting FAILED errors on start which are incorrect, and fail to remove pid errors on stop which are also incorrect?</p>